[IronPython] true division?

Gary Stephenson garys at ihug.com.au
Fri Sep 22 01:58:52 CEST 2006


What does the wink mean?  Is it not a fair question as to why a simple 
statement seems to work for John (and presumably both Seo and yourself) and 
yet fails for me?  Both syntaxes ("import __future__" and "from __future__ 
import division") return the same ImportError.  Why?

Have I offended someone?  Broken some unwritten law perhaps?  ( .. segues 
into some old Dinsdale and Doug routine here ... )

puzzledly yrs,

gary

----- Original Message ----- 
From: "Michael Foord" <fuzzyman at voidspace.org.uk>
To: "Discussion of IronPython" <users at lists.ironpython.com>
Sent: Friday, September 22, 2006 8:10 AM
Subject: Re: [IronPython] true division?


> Gary Stephenson wrote:
>> Thanks John (and Seo),
>>
>> When I attempt the same thing I get:
>>
> Of course. The correct syntax is:
>>>> from __future__ import division
>
> ;-)
>
> Fuzzyman
> http://www.voidspace.org.uk
>
>
>> IronPython 1.0.60816 on .NET 2.0.50727.42
>> Copyright (c) Microsoft Corporation. All rights reserved.
>>
>>>>> import __future__
>>>>>
>> Traceback (most recent call last):
>>   File , line 0, in <stdin>##3
>>   File , line 0, in __import__##7
>> ImportError: No module named __future__
>>
>>
>> ???  I'm at a loss ...
>>
>> cheers,
>>
>> gary
>> ----- Original Message ----- 
>> From: "John Machin" <sjmachin at lexicon.net>
>> To: "Discussion of IronPython" <users at lists.ironpython.com>
>> Sent: Thursday, September 21, 2006 7:46 PM
>> Subject: Re: [IronPython] true division?
>>
>>
>>
>>> 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
>>>>>>
>>> _______________________________________________
>>> users mailing list
>>> users at lists.ironpython.com
>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>
>>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.12.6/453 - Release Date: 20/09/2006
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 




More information about the Ironpython-users mailing list