From: Georg Brandl Date: Sun, 6 Jan 2008 15:48:20 +0000 (+0000) Subject: #759525: document that dir() doesn't return metaclass attrs when given a class as... X-Git-Tag: v2.6a1~718 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91a4808aa8a0d5878a2e2d6cfa56fda7afb53233;p=python #759525: document that dir() doesn't return metaclass attrs when given a class as arg. --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 6720f19828..4f86fc71c6 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index fbc9d04bf3..c1f0f00939 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -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)