SF patch #872326: Generator expression implementation

(Code contributed by Jiwon Seo.)

The documentation portion of the patch is being re-worked and will be
checked-in soon.  Likewise, PEP 289 will be updated to reflect Guido's
rationale for the design decisions on binding behavior (as described in
in his patch comments and in discussions on python-dev).

The test file, test_genexps.py, is written in doctest format and is
meant to exercise all aspects of the the patch.  Further additions are
welcome from everyone.  Please stress test this new feature as much as
possible before the alpha release.
This commit is contained in:
Raymond Hettinger 2004-05-19 08:20:33 +00:00
parent 285cfccecb
commit 354433a59d
20 changed files with 1590 additions and 439 deletions

View file

@ -46,7 +46,7 @@ typedef struct _symtable_entry {
including free refs to globals */
int ste_generator; /* true if namespace is a generator */
int ste_opt_lineno; /* lineno of last exec or import * */
int ste_tmpname; /* temporary name counter */
int ste_tmpname; /* temporary name counter */
struct symtable *ste_table;
} PySymtableEntryObject;
@ -93,6 +93,9 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
#define OPT_EXEC 2
#define OPT_BARE_EXEC 4
#define GENERATOR 1
#define GENERATOR_EXPRESSION 2
#ifdef __cplusplus
}
#endif