[IPython-dev] Any reason to keep user_ns() as a call?

Fernando Perez fperez.net at gmail.com
Wed May 17 18:01:55 EDT 2006


Hi,

I'm starting to use the new api stuff, and was wondering about the
reasons behind

    def user_ns(self):
        return self.IP.user_ns

Why not just do

self.user_ns = self.IP.user_ns

in the constructor and access it without the extra function call?  If
we keep the api module explicitly as 'all members of this represent
the public API', we don't need to wrap everything into extra function
calls, which in python have non-negligible cost.

Before I change it, I want to double-check if I'm missing something.

f




More information about the IPython-dev mailing list