zopefoundation / zope.interface

Interfaces for Python
http://zopeinterface.readthedocs.io/
Other
330 stars 71 forks source link

`inspect.getmembers(InterfaceClass)` causes `TypeError` #249

Open d-maurer opened 3 years ago

d-maurer commented 3 years ago

Python 3; zope.interface==5.1.2

>>> from zope.interface import Interface
>>> from inspect import getmembers
>>> getmembers(type(Interface))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib/python3.6/inspect.py", line 342, in getmembers
    value = getattr(object, key)
  File ".../eggs/zope.interface-5.1.2-py3.6-linux-x86_64.egg/zope/interface/declarations.py", line 394, in implementedBy
    spec_name = _implements_name(cls)
  File ".../eggs/zope.interface-5.1.2-py3.6-linux-x86_64.egg/zope/interface/declarations.py", line 292, in _implements_name
    '.' + (getattr(ob, '__name__', '?') or '?')
TypeError: unsupported operand type(s) for +: 'property' and 'str'