just curious

News M Claveau /Hamster-P essai1 at mci.local
Sat Sep 6 10:17:57 CEST 2003


Hi !

In
     def g(a,b):
         a=a+b

a new object "a" is create ; but it's a local object, who are not the "a"
global.
In python, variables are "pointer to object".

If you try :
     def g(a,b):
         global a
         a=a+b
You obtain :   "name 'a' is global and local"

@-salutations
-- 
Michel Claveau






More information about the Python-list mailing list