From 872de8af1f3761d4737672dab2f50a225ab0423e 2016-11-07 18:24:26 From: Paul Ivanov Date: 2016-11-07 18:24:26 Subject: [PATCH] restore tab completion behavior this is a minimal patch to restore proper tab completion behavior, a partial revert of #8355. I think avoiding the explicit poking into the __bases__ classes address the concerns #8330. --- 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