diff --git a/IPython/utils/dir2.py b/IPython/utils/dir2.py index 50805e0..b50654f 100644 --- a/IPython/utils/dir2.py +++ b/IPython/utils/dir2.py @@ -40,6 +40,9 @@ def dir2(obj): # TypeError: dir(obj) does not return a list words = set() + if safe_hasattr(obj, '__class__'): + words |= set(dir(obj.__class__)) + # filter out non-string attributes which may be stuffed by dir() calls # and poor coding in third-party modules