Closed
Description
current scenario:
running dir
on type
gives this
['__abstractmethods__', '__base__', '__bases__', '__basicsize__', '__call__',
'__class__', '__delattr__', '__dict__', '__dictoffset__', '__dir__', '__doc__',
'__eq__', '__flags__', '__format__', '__ge__', '__getattribute__', '__gt__',
'__hash__', '__init__', '__init_subclass__', '__instancecheck__',
'__itemsize__', '__le__', '__lt__', '__module__', '__mro__', '__name__',
'__ne__', '__new__', '__prepare__', '__qualname__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasscheck__', '__subclasses__', '__subclasshook__',
'__text_signature__', '__weakrefoffset__', 'mro']
but when we do,
type.__abstractmethods__
it gives,
AttributeError: __abstractmethods__
I ran type
on every attribute of every builtin, (like, type(zip.__init__)
, type(type.__base__)
, type(super.__thisclass__)
, ...)
and this was the only one that resulted in an error.
expected scenario:
- either change the implementation of
__abstractmethods__
to return an empty frozen set, - or change
dir
to not return__abstractmethods__
fortype
.
related issue,
https://stackoverflow.com/questions/24914584/abstractmethods-and-attributeerror