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
99b25335
Commit
99b25335
authored
Nov 16, 2005
by
Nick Coghlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring handling of genexpr in line with other anonymous scope names
parent
a3fd07d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
Python/symtable.c
Python/symtable.c
+3
-4
No files found.
Python/symtable.c
View file @
99b25335
...
...
@@ -170,7 +170,7 @@ static int symtable_visit_params_nested(struct symtable *st, asdl_seq *args);
static
int
symtable_implicit_arg
(
struct
symtable
*
st
,
int
pos
);
static
identifier
top
=
NULL
,
lambda
=
NULL
;
static
identifier
top
=
NULL
,
lambda
=
NULL
,
genexpr
=
NULL
;
#define GET_IDENTIFIER(VAR) \
((VAR) ? (VAR) : ((VAR) = PyString_InternFromString(# VAR)))
...
...
@@ -1329,14 +1329,13 @@ symtable_visit_slice(struct symtable *st, slice_ty s)
static
int
symtable_visit_genexp
(
struct
symtable
*
st
,
expr_ty
e
)
{
identifier
tmp
;
comprehension_ty
outermost
=
((
comprehension_ty
)
(
asdl_seq_GET
(
e
->
v
.
GeneratorExp
.
generators
,
0
)));
/* Outermost iterator is evaluated in current scope */
VISIT
(
st
,
expr
,
outermost
->
iter
);
/* Create generator scope for the rest */
tmp
=
PyString_FromString
(
"<genexpr>"
);
if
(
!
symtable_enter_block
(
st
,
tmp
,
FunctionBlock
,
(
void
*
)
e
,
0
))
{
if
(
!
symtable_enter_block
(
st
,
GET_IDENTIFIER
(
genexpr
),
FunctionBlock
,
(
void
*
)
e
,
0
))
{
return
0
;
}
st
->
st_cur
->
ste_generator
=
1
;
...
...
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