Skip to content

Commit 5cf6f52

Browse files
author
llllllllll
committed
Makes old style classes and instances show __dict__ in the autocomplete.
1 parent e83fb4a commit 5cf6f52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bpython/autocomplete.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import re
3434
import rlcompleter
3535
import sys
36+
from types import InstanceType, ClassType
3637
from six.moves import range, builtins
3738
from six import string_types, iteritems
3839

@@ -539,6 +540,9 @@ def attr_lookup(obj, expr, attr):
539540
words.remove('__abstractmethods__')
540541
except ValueError:
541542
pass
543+
if isinstance(obj, (InstanceType, ClassType)):
544+
# Account for the __dict__ in an old-style class.
545+
words.append('__dict__')
542546

543547
matches = []
544548
n = len(attr)

0 commit comments

Comments
 (0)