diff --git a/IPython/utils/dir2.py b/IPython/utils/dir2.py index f6f164f..62797ae 100644 --- a/IPython/utils/dir2.py +++ b/IPython/utils/dir2.py @@ -41,6 +41,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