The global statement

Duncan Booth duncan at
Thu Jul 24 09:48:32 CEST 2003

Andy Jewell <andy at> wrote in
news:mailman.1058999017.16056.python-list at 

> I found it easier to envisage the Python global statement as the
> inverse of the Pascal/Modula/C  concept:

Indeed, Pascal/Modula/C say "here's a variable, use it anywhere! Program 
structure? Who needs it?". Python, OTOH, requires you to say near the point 
of use "I am going to break the rules of good program design, but just for 
this function."

In some ways this is analagous to the COMEFROM statement (see Just not very.

Duncan Booth                                             duncan at
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

More information about the Python-list mailing list