[Tutor] What is in future?
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Fri, 19 Oct 2001 15:32:11 -0700 (PDT)
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.
Also, true division is something new for Python 2.2 --- it won't work for
anything below Python 2.2, so be careful about not using this for code
that's supposed to be compatible with older systems.
Good luck!