[Python-Dev] replacing 'global'

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Oct 28 18:28:39 EST 2003


Alex Martelli <aleaxit at yahoo.com>:

> i.e., the 'outer' statement should be
>     'outer' expr_stmt

The way I was thinking, "outer" wouldn't be a statement
at all, but a modifier applied to an indentifier in a
binding position. So, e.g.

  x, outer y, z = 1, 2, 3

would be legal, meaning that x and z are local and
y isn't, and

    outer x = 1; y = 2

would mean y is local and x isn't. To make both
x and y non-local you would have to write

    outer x = 1; outer y = 2

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list