Re: import reassignment different at module and function scope

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 05:31:47 -0200, Brendan Miller escribió: If I: import sys sys = sys.version This executes find but: import sys def f(): sys = sys.version This gives an error indicating that the sys on the right hand side of = is undefined. What gives? Python doesn't have local

Re: import reassignment different at module and function scope

2009-01-30 Thread Chris Rebert
On Fri, Jan 30, 2009 at 11:31 PM, Brendan Miller wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > If I: > > import sys > > sys = sys.version > > This executes find but: > > import sys > > def f(): >sys = sys.version > > This gives an error indicating that the sys on the right hand

import reassignment different at module and function scope

2009-01-30 Thread Brendan Miller
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I: import sys sys = sys.version This executes find but: import sys def f(): sys = sys.version This gives an error indicating that the sys on the right hand side of = is undefined. What gives? -BEGIN PGP SIGNATURE- Version: GnuPG v1