Alan Gauld wrote: >> messing about with classes I've come across something basic that I >> don't understand. > > > As you say this has nothing to do with classes its more basic. Its > about namespaces. Try reading the namespaces topic in my tutor for > more info. > > Meanwhile lets simplify by removing the class bit > > > def h(): > global x > x += 1 > print x > > h() # prints 43
Many thanks to Alan, Andrei, Hugo and Welsey for helping me to understand where I was going wrong. I thought I understood namespaces but _obviously_ not . Thanks again, Nick . _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor