Skip to content

Commit

Permalink
Python2.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cdgriffith committed Mar 16, 2017
1 parent a2e54e1 commit 84f5d8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions box.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ def __dir__(self):

out = dir(dict) + ['to_dict', 'to_json']
# Only show items accessible by dot notation
for x in self.keys():
if " " not in x and not x[0].isnumeric() and x not in builtins:
for letter in x:
for key in self.keys():
if (" " not in key and
key[0] not in string.digits and
key not in builtins):
for letter in key:
if letter not in allowed:
break
else:
out.append(x)
out.append(key)

if yaml_support:
out.append('to_yaml')
Expand Down

0 comments on commit 84f5d8a

Please sign in to comment.