mirror of
https://github.com/python/cpython.git
synced 2026-05-14 22:40:42 +00:00
#759525: document that dir() doesn't return metaclass attrs when given a class as arg.
This commit is contained in:
parent
db210dfba2
commit
91a4808aa8
2 changed files with 7 additions and 1 deletions
|
|
@ -302,7 +302,8 @@ available. They are listed here in alphabetical order.
|
|||
Because :func:`dir` is supplied primarily as a convenience for use at an
|
||||
interactive prompt, it tries to supply an interesting set of names more than it
|
||||
tries to supply a rigorously or consistently defined set of names, and its
|
||||
detailed behavior may change across releases.
|
||||
detailed behavior may change across releases. For example, metaclass attributes
|
||||
are not in the result list when the argument is a class.
|
||||
|
||||
|
||||
.. function:: divmod(a, b)
|
||||
|
|
|
|||
|
|
@ -195,6 +195,11 @@ Note:
|
|||
name. If the optional *predicate* argument is supplied, only members for which
|
||||
the predicate returns a true value are included.
|
||||
|
||||
.. note::
|
||||
|
||||
:func:`getmembers` does not return metaclass attributes when the argument
|
||||
is a class (this behavior is inherited from the :func:`dir` function).
|
||||
|
||||
|
||||
.. function:: getmoduleinfo(path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue