[SciPy-dev] Some suggestions for scipy_core

Fernando Perez Fernando.Perez at colorado.edu
Mon Jan 2 12:49:29 CST 2006

Francesc Altet wrote:
> A Dilluns 02 Gener 2006 18:05, Fernando Perez va escriure:
>>>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
> [snip]
> Yes, I knew this. But the point is that newbie users (and not as
> newbie, because I find toggling autocall on and off a bit annoying),
> will be somewhat surprised about the results. This was actually the
> main reason why I've decided to turn off the __call__() in many
> objects in PyTables. The other reason is that I replaced __call__() by
> more meaningful names and the result is far more readable (you know,
> explicit is better than implicit).

I've toyed with the idea of making the autocall flag be a 0,1,2 integer, where 
today's 'on' would become 2 for 'full', while 1 would be an intermediate mode, 
doing autocall ONLY if there are arguments:

1: foo bar -> foo(bar)
    foo     -> foo

2: foo bar -> foo(bar)
    foo     -> foo()

But I'm out of time for more significant ipython work for now, I'm afraid (a 
lot of new features went in recently, but now I need to work on other things).

Vote if you like it, though, and I'll consider it for the future.



More information about the Scipy-dev mailing list