HELP : class and variables

Batista, Facundo FBatista at uniFON.com.ar
Mon Sep 1 12:30:09 EDT 2003


#- class test:
#-   var1=1
#-   var2=2
#-   res=var1+var2
#- 
#- t=test()
#- print t.res
#- >> 3

So far OK.


#- t.var1=6
#- print t.res
#- >> 3

Because you can not change a class attribute changing the instance
attribute.

Just google for "class variables in python".

.	Facundo





More information about the Python-list mailing list