[IPython-user] Autocall behaviour

Fernando Perez Fernando.Perez at colorado.edu
Sun Mar 12 19:25:03 CST 2006


John Hunter wrote:
>>>>>>"Ville" == Ville Vainio <vivainio at gmail.com> writes:
> 
> 
>     Ville> Oh, ok. If you feel like playing with the SVN version
>     Ville> easily w/o using SVN, you can do
> 
> I just updated from svn and am having some autocall problems too.  I
> read through the previous thread but did not follow everything.  Is
> this supposed to be fixed, or am I missing something?  I would expect
> "Smart" to use autocall in the example below

Well, I think it's doing precisely what we want:

> In [1]: d = dict(name='john')
> 
> In [2]: autocall 1
> Automatic calling is: Smart
> 
> In [3]: d.keys
> Out[3]: <built-in method keys of dict object at 0x8441e84>

The whole point of 'smart' mode is to give you a way of seeing a callable 
object without firing a call on it.  This had been often requested by users 
who would do

foo

and foo would be called automatically, even when they didn't expect or want 
it.  So this is not a bug or a limitation, it's how the feature was designed 
to be.  I personally tend to keep my autocall set at 2, like Ville suggested, 
but the current behavior of 'smart' mode is precisely what some users 
requested for a long time.

Cheers,

f




More information about the IPython-user mailing list