[IPython-user] Unexpected behavior on __getattribute__ in Ipython

Kenneth Arnold kenneth.arnold@gmail....
Tue Aug 4 08:32:43 CDT 2009


I suspect autocall. Try `autocall 0`.
-Ken



On Tue, Aug 4, 2009 at 6:24 AM, Wong, Shin Guey<shin.guey.wong@intel.com> wrote:
> Here is the code:
> class A(object):
>    def __getattribute__(self, name):
>        print "__getattribute__ called"
>        return object.__getattribute__(self, name)
>
>    y = "hello"
>
> a = A()
> print a.y
> print
> print A.y
>
> expected --output:--
> __getattribute__ called
> hello
>
> hello
> ================================================
> but I get --output: --
> __getattribute__ called
> __getattribute__ called
> hello
>
> hello
> ==================================================
>
> Can anyone duplicate this behavior? Or it is only happened at my setup?
> When I run it without Ipython, I can get eh expected output.
>
> Regards,
> Shin Guey
> _______________________________________________
> IPython-user mailing list
> IPython-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>


More information about the IPython-user mailing list