[IPython-user] %paste and integer division

Brian Granger ellisonbg@gmail....
Sun Mar 14 15:30:11 CDT 2010


Just to double check, what do the following give (leaving autocall on):

2/3

then:

print(2/3)

Brian

On Sun, Mar 14, 2010 at 12:34 PM,  <butterw@gmail.com> wrote:
> I'm configured to get rid of the old integer division, but %paste doesn't
> take this into account, which is a pain.
>
> ipy_user_conf.py :
> # for sane integer division that converts to float (1/2 == 0.5)
> o.autoexec.append('from __future__ import division')
>
> Turning autocall off doesn't make any difference here. Not that I would want
> to turn autocall off.



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu
ellisonbg@gmail.com


More information about the IPython-user mailing list