<method-wrapper>.__self__

Michael Hudson mwh at python.net
Wed Jul 21 15:18:15 CEST 2004


Hallvard B Furuseth <h.b.furuseth at usit.uio.no> writes:

> What's the difference between a built-in method and a method-wrapper
> object?

I *think* method-wrapper's are wrappers around type methods, aka
tp_wotsit slots at the C level.  builtin-methods are, well, builtin
methods, similar to method's on regular Python classes but implemented
in C.

> Why has only the former a __self__, even though both are tied to the
> object on which to perform the operation?

Because.

Probably an oversight.

> Why do list.pop and list.__len__ have different types at all?

Well, because they do :-)  See above.

If you want to really dig into this sort of thing, you're going to
need to read some source.

Cheers,
mwh

-- 
  Windows 2000: Smaller cow. Just as much crap.
                           -- Jim's pedigree of operating systems, asr



More information about the Python-list mailing list