This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients ncoghlan
Date 2012-04-11.04:46:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334119591.44.0.0449104949206.issue14544@psf.upfronthosting.co.za>
In-reply-to
Content
The language spec currently includes the following paragraph [1]:

   Names listed in a global statement must not be defined as
   formal parameters or in a for loop control target, class
   definition, function definition, or import statement.

While the first restriction is real (and enforced by CPython), since formal parameters are explicitly defined as local variables, there's no obvious rationale for the last 4 restrictions (and CPython doesn't enforce any of them).

The proposal is that the paragraph be simplified to:

   Names listed in a global statement must not also be defined as
   formal function parameters. Attempting to do so raises SyntaxError.

The current (incorrect!) CPython implementation detail note will be removed.

A similar clarification will also be made in the "nonlocal" statement documentation.

[1] http://docs.python.org/dev/reference/simple_stmts.html#the-global-statement
History
Date User Action Args
2012-04-11 04:46:31ncoghlansetrecipients: + ncoghlan
2012-04-11 04:46:31ncoghlansetmessageid: <1334119591.44.0.0449104949206.issue14544@psf.upfronthosting.co.za>
2012-04-11 04:46:30ncoghlanlinkissue14544 messages
2012-04-11 04:46:30ncoghlancreate