Permalink
Browse files

Merge pull request #36 from blairhudson/master

  • Loading branch information...
yuvipanda committed Sep 25, 2017
2 parents aae209f + f663f8f commit 478deb6f45fe84d2a94c9eff76eeb918d0cb4280
Showing with 4 additions and 2 deletions.
  1. +4 −2 ipynb/utils.py
View
@@ -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

0 comments on commit 478deb6

Please sign in to comment.