Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cf672f15
Commit
cf672f15
authored
Oct 18, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for local assigned to only in a nested list comp
parent
961dfe0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
Lib/test/output/test_scope
Lib/test/output/test_scope
+1
-0
Lib/test/test_scope.py
Lib/test/test_scope.py
+18
-0
No files found.
Lib/test/output/test_scope
View file @
cf672f15
...
...
@@ -20,3 +20,4 @@ test_scope
19. var is bound and free in class
20. interaction with trace function
20. eval with free variables
21. list comprehension with local variables
Lib/test/test_scope.py
View file @
cf672f15
...
...
@@ -485,3 +485,21 @@ else:
print
"eval() should have failed, because code contained free vars"
warnings
.
resetwarnings
()
print
"21. list comprehension with local variables"
try
:
print
bad
except
NameError
:
pass
else
:
print
"bad should not be defined"
def
x
():
[
bad
for
s
in
'a b'
for
bad
in
s
.
split
()]
x
()
try
:
print
bad
except
NameError
:
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment