This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hongweipeng
Recipients hongweipeng
Date 2021-12-16.15:40:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>
In-reply-to
Content
root@debian:/workspace/cpython# ./python
Python 3.11.0a3+ (heads/main-dirty:b123ad8030, Dec 16 2021, 06:16:15) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> class Foo:
...   def __getattr__(self, attr):
...     return None
... 
>>> inspect.getmembers(Foo())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/workspace/cpython/Lib/inspect.py", line 488, in getmembers
    return _getmembers(object, predicate, getattr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/cpython/Lib/inspect.py", line 455, in _getmembers
    for base in object.__bases__:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
History
Date User Action Args
2021-12-16 15:40:43hongweipengsetrecipients: + hongweipeng
2021-12-16 15:40:43hongweipengsetmessageid: <1639669243.89.0.636826061264.issue46103@roundup.psfhosted.org>
2021-12-16 15:40:43hongweipenglinkissue46103 messages
2021-12-16 15:40:43hongweipengcreate