power of explicit self?
Tim Roberts
timr at probo.com
Sun Dec 13 22:37:40 EST 2009
Fire Crow <me at firecrow.com> wrote:
>> It's not implemented in the compiler. There's a place in the runtime
>> for invoking a method where the object is inserted at the beginning
>> of the parameter list. IIRC, that's done by wrapping the function
>> object.
>
>This is the source of Objects/methodobject.c it look like this is
>where self is added to the argument list, but I'll have to do some
>more digging.
Well, that's where the owning object is added, but that would be required
whether "self" were implicit or explicit. C++ would have the same kind of
code to push "this", for example, even though "this" is not shown in the
parameter list.
I agree with the other repliers. "Explicit" self is not "implemented"
anywhere. It's just an implementation decision.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-list
mailing list