[IPython-dev] from __future__ import division

Darren Dale dd55 at cornell.edu
Wed Jun 14 17:16:59 EDT 2006


Fernando, didnt you change ipython's pylab mode to support the new division 
operation by default, or did I imagine that?

Darren


On Wednesday 14 June 2006 13:57, Fernando Perez wrote:
> On 6/12/06, Gaël Varoquaux <gael.varoquaux at normalesup.org> wrote:
> >         Hi,
> >
> > I am using ipython to do some numerical work with pylab. At the beginning
> > of each script I have "from __future__ import division". When I use these
> > scripts with "ipython -pylab" (calling them with a %run -i foobar"),
> > pylab doesn't see this import, and thus the script has bugs. One option
> > is to load ipython without the -pylab switch and load pylab afterwards,
> > but this is to the cost of the nice non blocking pylab interface.
> >
> > Is there a way to make such an import before pylab gets loaded ? If not
> > this may be a useful feature (maybe adding a "-division" switch on the
> > command line call).
>
> Mmh, I don't see this problem:
>
> In [1]: 1/2
> Out[1]: 0
>
> In [2]: cat div.py
> from __future__ import division
>
> print '1/2',1/2
>
> In [3]: run div.py
> 1/2 0.5
>
> What version are you running?
>
> Cheers,
>
> f
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.net
> http://scipy.net/mailman/listinfo/ipython-dev

-- 
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55 at cornell.edu
office: (607) 255-9894
fax: (607) 255-9001




More information about the IPython-dev mailing list