[pypy-commit] pypy pep526: Add another symtable test to ensure proper scoping of non-Name targets.
alcarithemad
pypy.commits at gmail.com
Thu Mar 1 05:08:00 EST 2018
Author: Colin Valliant <alcarithemad at gmail.com>
Branch: pep526
Changeset: r93919:7a50e0c20060
Date: 2018-02-14 22:04 -0800
http://bitbucket.org/pypy/pypy/changeset/7a50e0c20060/
Log: Add another symtable test to ensure proper scoping of non-Name
targets.
diff --git a/pypy/interpreter/astcompiler/test/test_symtable.py b/pypy/interpreter/astcompiler/test/test_symtable.py
--- a/pypy/interpreter/astcompiler/test/test_symtable.py
+++ b/pypy/interpreter/astcompiler/test/test_symtable.py
@@ -513,6 +513,9 @@
assert fscp.contains_annotated == False
assert fscp.lookup("x") == symtable.SCOPE_LOCAL
+ def test_nonsimple_annotation(self):
+ fscp = self.func_scope("def f(): implicit_global[0]: int")
+ assert fscp.lookup("implicit_global") == symtable.SCOPE_GLOBAL_IMPLICIT
def test_issue13343(self):
scp = self.mod_scope("lambda *, k1=x, k2: None")
More information about the pypy-commit
mailing list