confusion about __getattr__

Russ Cox rsc at plan9.bell-labs.com
Thu Jan 17 01:09:59 EST 2002


> But in order to determine the string to be printed after the "of"
> (e.g., a string representation of the class) it tries to lookup the
> __repr__ method in the class.  This gets trapped by your __getattr__
> which returns a string which is invalid for Python to call as
> __repr__.

Thanks.  All is clear now.

Russ






More information about the Python-list mailing list