[docs] Bug in the Reference Data Model

Ted Yin ted.sybil at gmail.com
Sun Apr 14 12:02:18 CEST 2013


Hi Georg,

I'm glad to get your reply. Hard to imagine how a sophisticated document
project like python reference is maintained. Your work is really
appreciated.
Cheer up and move on!

Ted


On Sun, Apr 14, 2013 at 5:54 PM, Georg Brandl <georg at python.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 02.02.2012 05:53, schrieb Ted Yin:
> > 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) :
> >
> > ...     @classmethod ...     def cm(cls) : print cls
> >
> > ...
> >>>> C.cm
> > <bound method type.cm of <class '__main__.C'>>
> >
> >>>> C.cm.im_self
> > <class '__main__.C'>
> >
> >>>> C.cm.im_class
> > <type 'type'>
> >
> > |
> >
> > 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'.
>
> Hi Ted,
>
> thanks for the report, this has now been (belatedly) fixed and should
> appear online soon.
>
> cheers,
> Georg
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.19 (GNU/Linux)
>
> iEUEARECAAYFAlFqfL4ACgkQN9GcIYhpnLA6IgCYyKJG4tP9DQu4pKmgsYsdbV0l
> LgCdHa43mO+x62CrniBTC0wr07/5oVU=
> =XCYb
> -----END PGP SIGNATURE-----
>



-- 
--- This information is automatically generated ---
Welcome to My Blog : http://www.tedyin.com/blog/

ted.sybil aka. ymfoi aka. Ted Yin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20130414/35ffb55b/attachment.html>


More information about the docs mailing list