]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport rev 2.132 (note: some earlier bugfix candidates still TBD).
authorGuido van Rossum <guido@python.org>
Thu, 18 Apr 2002 00:37:10 +0000 (00:37 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 18 Apr 2002 00:37:10 +0000 (00:37 +0000)
commit00413c56dabfaa22f89af681dff4bccf6bdfd20a
tree267f3b5b40bf95ae99da664c80f0c21c96d67b57
parent95c168cf68b0310b2ee00bf96b7902c59355c90f
Backport rev 2.132 (note: some earlier bugfix candidates still TBD).

SF bug 542984.

Change type_get_doc (the get function for __doc__) to look in tp_dict
more often, and if it finds a descriptor in tp_dict, to call it (with
a NULL instance).  This means you can add a __doc__ descriptor to a
new-style class that returns instance docs when called on an instance,
and class docs when called on a class -- or the same docs in either
case, but lazily computed.

I'll also check this into the 2.2 maintenance branch.
Lib/test/test_descr.py