[IronPython] true division?

John Machin sjmachin at lexicon.net
Thu Sep 21 02:46:07 PDT 2006


On 21/09/2006 7:27 PM, Sanghyeon Seo wrote:
> 2006/9/21, Gary Stephenson <garys at ihug.com.au>:
>> Is there a way to get true division in ipy without using the -Qnew command
>> line option?  On a per-module or per-instance basis?
>>
>> "from __future__ import true_division"
>> returns "SyntaxError: future feature is not defined: true_division"
> 
> Of course. The correct syntax is:
> from __future__ import division
> 

Indeed. And introspection is a wonderful thing :-)

DOS_prompt>\ironpython\ipy
IronPython 1.0.60816 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> import __future__
 >>> [x for x in __future__.all_feature_names if 'div' in x]
['division']
 >>> ^Z




More information about the users mailing list