Skip to content

Commit

Permalink
Fix for #34 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
blairhudson committed Sep 19, 2017
1 parent e1b8bf2 commit f663f8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ipynb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def node_predicate(node):
if isinstance(node, an):
return True

# Recurse through Assign node LHS targets when an id is not specified,
# otherwise check that the id is uppercase
if isinstance(node, ast.Assign):
return all([t.id.isupper() for t in node.targets if hasattr(t, 'id')]) \
and all([[e.id.isupper() for e in t.elts] for t in node.targets if hasattr(t, 'elts')])
return all([node_predicate(t) for t in node.targets if not hasattr(t, 'id')]) \
and all([t.id.isupper() for t in node.targets if hasattr(t, 'id')])

return False

Expand Down

0 comments on commit f663f8f

Please sign in to comment.