laike9m / pdir2

Pretty dir() printing with joy:beer:
MIT License
1.32k stars 47 forks source link

Could not handle `__abstractmethods__` #19

Closed brickgao closed 7 years ago

brickgao commented 7 years ago

It throws an exception when I use pdir(type) in Python 3.6.0, seems pdir couldn't handle __abstractmethods__:

In [2]: pdir(type)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-71dd3095056f> in <module>()
----> 1 pdir(type)

/usr/local/lib/python3.6/site-packages/pdir/api.py in __init__(self, obj)
     26             source = {}
     27             for name in dir(obj):
---> 28                 attr = self.__getattr_wrapper(name)
     29                 if attr is not skipped_attribute:
     30                     source[name] = attr

/usr/local/lib/python3.6/site-packages/pdir/api.py in __getattr_wrapper(self, name)
     83         if name in skipped_attribute_names:
     84             return skipped_attribute
---> 85         return getattr(self.obj, name)
     86
     87     def __inspect_category(self, source):

AttributeError: __abstractmethods__