[IPython-dev] Should we disable autocall by default from now on?

Fernando Perez fperez.net@gmail....
Wed Nov 30 01:07:52 CST 2011


Hi folks,

over the years, we've had a number of bug reports that ultimately boil
down to ipython doing an extra getattr call on objects at the prompt,
such as

https://github.com/ipython/ipython/issues/988
https://github.com/ipython/ipython/issues/851

While this may appear odd, people do have code out there that mutates
the state of objects on simple getattr calls, and so *any*
introspection on such objects, no matter how carefully done, mutates
them.  The last example comes from Traits code, which is famous for
having complex semantics attached to attribute access.

Since this is a recurring problem, I'm trying to decide whether the
convenience of autocall being on by default is worth against the
occasional surprise of situations like these.

Obviously we'd leave the functionality of autocall as-is, and people
could still enable it if they wanted to.  I'm only talking about
whether it should be completely off by default.  The reason why
defaults matter a lot is that the vast majority of users never ever
change them (I've seen countless long-term users with the wrong colors
for a light bacgkround, the one default we can't pick for them and
that leads to unreadable tracebacks, yet people live with it for
years).  So it's up to us to give people defaults that lead to the
best experience possible.

I personally had always fallen on the side of saying that autocall is
a big convenience of ipython, and that code that mutates on simple
attribute access is special enough that we shouldn't sacrifice that
convenience for most users to accommodate such a special case.

But I'm not sure anymore if that's the right balance, given the
recurring nature of these reports (the above are just the two most
recent ones, I've answered this question in one form or another
probably 20 times or more over the years).

So I'd like to hear some feedback, as we're getting ready to put 0.12
out the door soon...

Cheers,

f


More information about the IPython-dev mailing list