Permalink
Browse files

Fix for ipython#34 (comment)

  • Loading branch information...
blairhudson committed Sep 19, 2017
1 parent e1b8bf2 commit f663f8f04b0574fc4d6c11a8f85de6b337030bd3
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 f663f8f

Please sign in to comment.