On Jul 2, 3:55 pm, Hrvoje Niksic <hnik...@xemacs.org> wrote: > Terry <twest...@gmail.com> writes: > > Future division ("from __future__ import division") works within > > scripts executed by import or execfile(). However, it does not work > > when entered interactively in the interpreter like this: > > >>>> from __future__ import division > >>>> a=2/3 > > Are you referring to the interactive interpreter normally invoked by > just running "python"? That seems to work for me: > > Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> 2/3 > 0 > >>> from __future__ import division > >>> 2/3 > > 0.6666666666666666
Yes, that works for me on my Mac. The problem I'm having is in a Python interpreter that I built for the iPhone. It uses PyRun_SimpleString() to execute user entered commands. After you import future division, it does not seem to remember it on subsequent commands. -- http://mail.python.org/mailman/listinfo/python-list