[IPython-user] %paste and integer division
Tue Mar 16 14:05:06 CDT 2010
Any thoughts on this? It is quite odd that %paste is not respecting
the division mode.
On Sun, Mar 14, 2010 at 10:27 PM, Peter Butterworth <firstname.lastname@example.org> wrote:
> In : 2/3
> Out: 0.66666666666666663
> In : print(2/3)
> On Sun, Mar 14, 2010 at 9:30 PM, Brian Granger <email@example.com> wrote:
>> Just to double check, what do the following give (leaving autocall on):
>> On Sun, Mar 14, 2010 at 12:34 PM, <firstname.lastname@example.org> 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
> peter butterworth
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
More information about the IPython-user