diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-20 16:20:16 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-11-20 16:20:16 (GMT) |
commit | cc7ebb8f69b84bc48ab2bcccf4f7a30f5e7479d2 (patch) | |
tree | de155ac9a70ceeec0386984932c26ea0a37f6f68 /Doc/library | |
parent | 45ec42615725d2c854f3cc04d73fb72017138d54 (diff) | |
download | cpython-cc7ebb8f69b84bc48ab2bcccf4f7a30f5e7479d2.zip cpython-cc7ebb8f69b84bc48ab2bcccf4f7a30f5e7479d2.tar.gz cpython-cc7ebb8f69b84bc48ab2bcccf4f7a30f5e7479d2.tar.bz2 |
Issue 9732: remove use of __class__ in inspect.getattr_static and note the mro exception to code execution
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/inspect.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 2f09348..32e56e5 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -598,11 +598,13 @@ any of these then you deserve to have everything break anyway): member deleted from the class, or a fake `__slots__` attribute attached to the instance, or any other monkeying with `__slots__` -* objects that lie about their type by having `__class__` as a - descriptor (`getattr_static` traverses the :term:`MRO` of whatever type - `obj.__class__` returns instead of the real type) * type objects that lie about their :term:`MRO` +.. note:: + + Classes that override :data:`~object.__mro__` as a property will have this + code executed by `getattr_static`. + Descriptors are not resolved (for example slot descriptors or getset descriptors on objects implemented in C). The descriptor is returned instead of the underlying attribute. |