From: "Jean-Michel Pichavant" <jeanmic...@sequans.com> > > Octavian Rasnita wrote: >> It is true that Python doesn't use scope limitations for variables? >> >> Octavian >> > Python does have scope. The problem is not the lack of scope, to > problem is the shadow declaration of some python construct in the > current scope.
It's OK then. > print x # raise NameError > [x for x in range(10)] # shadow declaration of x > print x # will print 9 > > it can become a problem if you write such code: > > index = 1 > myNewList = [index*2 for index in [1,2,3,4,5]] > print myNewList(index) # here most new commer would want to use index=1. Yes, it is not such a big deal. Octavian -- http://mail.python.org/mailman/listinfo/python-list