[SciPy-dev] Some suggestions for scipy_core

Fernando Perez Fernando.Perez at colorado.edu
Mon Jan 2 11:05:04 CST 2006


> Maybe unrelated with this discussion, but important anyway because of
> the (supposedly) large userbase that ipython have is the fact that
> ipython will call the __call__() function for the object, if it founds
> it. This makes things worse for the (ipython) user that wants just to
> print the value of the dtype object.

This is a known case of the tension between convenience and correctness, that 
ipython tries (not always successfully) to balance.

Note that to aid a little in situations like these, ipython offers some options:

1. Toggle autocalling off for a while:

In [1]: int
------> int()
Out[1]: 0

In [2]: autocall
Automatic calling is: OFF

In [3]: int
Out[3]: <type 'int'>

You can turn it on again as needed.


2. Turn it off permanently in your ~/.ipython/ipythonrc file, if it's causing 
more problems than not:

autocall 0


3. If you just want to quickly print a value, the %p magic is short for 'print':

In [7]: int
------> int()
Out[7]: 0

In [8]: p int
<type 'int'>

(if you happen to have a 'p' variable, call %p, which is still a little less 
typing than 'print' :)


I hope this helps,

f




More information about the Scipy-dev mailing list