Preliminary support for "from __future__ import generators" to enable

the yield statement.  I figure we have to have this in before I can
release 2.2a1 on Wednesday.

Note: test_generators is currently broken, I'm counting on Tim to fix
this.
This commit is contained in:
Guido van Rossum 2001-07-15 21:08:29 +00:00
parent 045ca7ae72
commit b09f7ed623
8 changed files with 47 additions and 3 deletions

View file

@ -31,6 +31,8 @@ future_check_features(PyFutureFeatures *ff, node *n, char *filename)
feature = STR(CHILD(ch, 0));
if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) {
ff->ff_nested_scopes = 1;
} else if (strcmp(feature, FUTURE_GENERATORS) == 0) {
/* OK; this is processed by the parser */
} else if (strcmp(feature, "braces") == 0) {
PyErr_SetString(PyExc_SyntaxError,
"not a chance");