The global statement
Duncan Booth
duncan at NOSPAMrcp.co.uk
Thu Jul 24 03:48:32 EDT 2003
Andy Jewell <andy at wild-flower.co.uk> wrote in
news:mailman.1058999017.16056.python-list at python.org:
> 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
http://www.fortran.com/fortran/come_from.html). Just not very.
--
Duncan Booth duncan at rcp.co.uk
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