[Tutor] What is in future?

Steven Burr sburr@mac.com
Sat, 20 Oct 2001 10:36:30 -0700


On Friday, October 19, 2001, at 03:32 PM, Danny Yoo wrote:

> On Fri, 19 Oct 2001, Gregor Lingl wrote:
>
>> Hi!
>> Can anyone explain the following:
>>
>> Python 2.2b1 (#25, Oct 19 2001, 11:44:52) [MSC 32 bit (Intel)] on win32
>> Type "copyright", "credits" or "license" for more information.
>> IDLE 0.8 -- press F1 for help
>>>>> from __future__ import true_division
>> SyntaxError: future feature true_division is not defined (<pyshell#0>, 
>> line 1)
>
> According to:
>
>     http://python.sourceforge.net/peps/pep-0238.html
>
> the syntax to bring over true division from the future is:
>
> ###
> from __future__ import division
> ###
>
> However, I don't have Python 2.2 installed yet, I can't confirm that 
> this
> works.  Try it out, and tell us if this works for you.

$ python
Python 2.2a4 (#1, Oct  3 2001, 21:37:06)
[GCC 2.95.2 19991024 (release)] on darwin1
Type "help", "copyright", "credits" or "license" for more information.
 >>> from __future__ import division
 >>> 2/3
0.66666666666666663

There it is, floating point math in all its glory.  : )