Why doesn't __call__ lead to infinite recursion?
Michael Hudson
mwh at python.net
Mon Aug 18 09:13:22 EDT 2003
"Andrew Dalke" <adalke at mindspring.com> writes:
> Aahz:
> > No time to investigate further, but all your examples used classic
> > classes instead of new-style classes; I'm pretty sure that new-style
> > classes will more closely emulate the way functions work. There's also
> > the wrinkle I didn't mention that functions use a dict proxy IIRC.
>
> Interesting. Very interesting.
Yes :-)
You have to have something like this when you do things like 'print
type(foo)'. This should call the *types* *bound* __str__ method, not
try to call the *instances* *unbound* __str__ method...
Cheers,
mwh
--
Its unmanageable complexity has spawned more fear-preventing tools
than any other language, but the solution _should_ have been to
create and use a language that does not overload the whole goddamn
human brain with irrelevant details. -- Erik Naggum, comp.lang.lisp
More information about the Python-list
mailing list