mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Hide list comp variables and support set comprehensions
This commit is contained in:
parent
6ef6306dd6
commit
650f0d06d3
29 changed files with 2006 additions and 1323 deletions
|
@ -5,7 +5,7 @@ Here's an example of the sort of thing that is tested.
|
|||
>>> def f(x):
|
||||
... global x
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: name 'x' is local and global
|
||||
SyntaxError: name 'x' is parameter and global
|
||||
|
||||
The tests are all raise SyntaxErrors. They were created by checking
|
||||
each C call that raises SyntaxError. There are several modules that
|
||||
|
@ -373,7 +373,7 @@ Misuse of the nonlocal statement can lead to a few unique syntax errors.
|
|||
... nonlocal x
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: name 'x' is local and nonlocal
|
||||
SyntaxError: name 'x' is parameter and nonlocal
|
||||
|
||||
>>> def f():
|
||||
... global x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue