[IPython-dev] future division in embedded ipython

Bradley M. Froehle brad.froehle@gmail....
Wed Jul 4 13:56:27 CDT 2012


There is a somewhat hidden way to reset the the compiler flags, but definitely not for everyday use:

In [7]: from __future__ import division

In [8]: 1/2
Out[8]: 0.5

In [9]: get_ipython().compile.reset_compiler_flags()

In [10]: 1/2
Out[10]: 0



On Wednesday, July 4, 2012 at 10:51 AM, Aaron Meurer wrote:

> One thing that's worth pointing out: there's no way to "un-import"
> future flags (unless I missed it). So once you have future division,
> you're stuck with it.
> 
> Aaron Meurer
> 
> On Jul 4, 2012, at 11:38 AM, Thomas Kluyver <takowl@gmail.com (mailto:takowl@gmail.com)> wrote:
> 
> > On 4 July 2012 18:26, Carl Smith <carl.input@gmail.com (mailto:carl.input@gmail.com)> wrote:
> > > Maybe a configurable or something, so the user can set the way it works, and
> > > just document it?? I'm not really sure.
> > > 
> > 
> > 
> > We try not to add more configuration unless it looks like there's a
> > real need to have both options:
> > - If it's configurable, there's an extra maintenance burden of making
> > sure each option continues working in different scenarios.
> > - Most users will never go looking for an obscure config option, so it
> > doesn't relieve us from the burden of picking out a sensible default.
> > 
> > In this case, I'm leaning towards the view that embedded IPython
> > *should* inherit the future flags, without any config option. But it
> > warrants some discussion.
> > 
> > Thomas
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev@scipy.org (mailto:IPython-dev@scipy.org)
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> > 
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org (mailto:IPython-dev@scipy.org)
> http://mail.scipy.org/mailman/listinfo/ipython-dev
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120704/9caf7f02/attachment.html 


More information about the IPython-dev mailing list