[issue4199] add shorthand global and nonlocal statements

Jeremy Hylton jeremy at alum.mit.edu
Wed Feb 24 00:41:00 CET 2010


On Sat, Dec 6, 2008 at 1:28 PM, Benjamin Peterson
<report at bugs.python.org> wrote:
>
> Benjamin Peterson <musiccomposition at gmail.com> added the comment:
>
> I think I may have been merging add_ast_fields when I wrote the patch.
>
> Here's a new patch that handles "global x, = (5,)". To do it, I added a
> new flag* to the Global and Nonlocal AST objects that indicates whether
> the value needs to be unpacked or not.

You shouldn't need to do this.  The unpack is implied if the number of
identifiers is greater than 1.

Jeremy



> * The flag is an int. The bool AST type was removed in py3k.
>
> Added file: http://bugs.python.org/file12254/global_nonlocal_shorthand2.patch
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue4199>
> _______________________________________
> _______________________________________________
> Python-bugs-list mailing list
> Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/jeremy%40alum.mit.edu
>
>


More information about the Python-bugs-list mailing list