Class Attributes More Persistent : Attribute : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Attribute »

 

Class Attributes More Persistent


class C(object):
     spam = 100      

c1 = C()             
print c1.spam          

C.spam += 100        
print C.spam           
print c1.spam          

c2 = C()             
print c2.spam        
del c1           
print c2.spam



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Attribute