Skip to content
Browse files

fix linter: previous effect state could brake lambda arguments usage

  • Loading branch information...
1 parent 4c1632f commit 8bbcaa1a48641fa4fd59bb4e5c144c0e54889edd @baverman baverman committed Jan 14, 2012
Showing with 11 additions and 3 deletions.
  1. +4 −3 supplement/linter.py
  2. +7 −0 tests/test_linter.py
View
7 supplement/linter.py
@@ -339,9 +339,10 @@ def visit_Lambda(self, node):
self.scope = Scope(self.scope)
self.scope.lineno = node.lineno
self.scope.offset = node.col_offset
- with self.loop():
- with self.indirect(False):
- self.generic_visit(node)
+ with self.effect(None):
+ with self.loop():
+ with self.indirect(False):
+ self.generic_visit(node)
self.scope = self.scope.parent
View
7 tests/test_linter.py
@@ -228,3 +228,10 @@ def test_lambda():
def foo():
return lambda boo, bar: boo + bar
''')
+
+def test_lambda_assigned_to_var():
+ assert_names('''
+ def foo():
+ $result$ = lambda boo, bar: boo + bar
+ ''')
+

0 comments on commit 8bbcaa1

Please sign in to comment.
Something went wrong with that request. Please try again.