Objects in the class namespace can be accessed directly using the module name and dot . syntax. : Property : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Property »

 

Objects in the class namespace can be accessed directly using the module name and dot . syntax.


class tClass(object):
    def __init__(self, x):
        self.x = x
    def double(self):
        self.x += self.x

t = tClass (5)
print t.__dict__
print tClass.__dict__
print t.x
t.double()
print t.x



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Class
» Property