Skip to content

Commit

Permalink
Sort prop_ names on exceptions (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
olgabot authored and chriddyp committed Aug 7, 2017
1 parent 71f81cb commit 4f1d653
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dash/development/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, **kwargs):
raise Exception(
'Unexpected keyword argument `{}`'.format(k) +
'\nAllowed arguments: {}'.format(
', '.join(self._prop_names)
', '.join(sorted(self._prop_names))
)
)
setattr(self, k, v)
Expand Down Expand Up @@ -226,7 +226,8 @@ def __repr__(self):
if c is not self._prop_names[0])):
return '{typename}('+', '.join([c+'='+repr(getattr(self, c, None))
for c in self._prop_names if getattr(self, c, None) is not None])+')'
for c in self._prop_names
if getattr(self, c, None) is not None])+')'
else:
return '{typename}(' + repr(getattr(self, self._prop_names[0], None)) + ')'
Expand Down

0 comments on commit 4f1d653

Please sign in to comment.