diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2013-10-18 07:27:39 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2013-10-18 07:27:39 (GMT) |
commit | 63c141cacd0d655647430fe4b6a10c22d355aef2 (patch) | |
tree | 74d992cc1102dd4a538ed9d027e7b3aec0d045af /Doc | |
parent | 0e0cd46227bb3e95cc6395ef514bf13f0d30c668 (diff) | |
download | cpython-63c141cacd0d655647430fe4b6a10c22d355aef2.zip cpython-63c141cacd0d655647430fe4b6a10c22d355aef2.tar.gz cpython-63c141cacd0d655647430fe4b6a10c22d355aef2.tar.bz2 |
Close #19030: inspect.getmembers and inspect.classify_class_attrs
Order of search is now:
1. Try getattr
2. If that throws an exception, check __dict__ directly
3. If still not found, walk the mro looking for the eldest class that has
the attribute (e.g. things returned by __getattr__)
4. If none of that works (e.g. due to a buggy __dir__, __getattr__, etc.
method or missing __slot__ attribute), ignore the attribute entirely.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/inspect.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index de5a0b3..0da4056 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -173,9 +173,9 @@ attributes: .. note:: - :func:`getmembers` will only return metaclass attributes when the - argument is a class and those attributes have been listed in a custom - :meth:`__dir__`. + :func:`getmembers` will only return class attributes defined in the + metaclass when the argument is a class and those attributes have been + listed in the metaclass' custom :meth:`__dir__`. .. function:: getmoduleinfo(path) |