[docs] Bug in the Reference Data Model
ted.sybil at gmail.com
Thu Feb 2 05:53:42 CET 2012
It's said that :
When it would yield a class method object, it is transformed into a bound
user-defined method object whose im_class and im_self attributes are both C.
in the Reference <http://docs.python.org/reference/datamodel.html>
And I did an EX.
>>> class C(object) :
... def cm(cls) : print cls
<bound method type.cm of <class '__main__.C'>>
It's not hard for me to understand the result.
But unfortunately, in the reference, it's told that im_self should be *the
same* as im_class.
And in my opinion , 'im_self' shold be C, but im_class is 'type' since C's
metaclass is type. So they're obviously *not* 'both C'.
[This information is automatically generated]
*ted.sybil* aka. *ymfoi* aka. *Ted Yin*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs