Instance Objects Are Concrete Items : Instance « Class « Python Tutorial






class FirstClass:                  
    def setdata(self, value):      
        self.data = value    
    def display(self): 
        print self.data      

x = FirstClass(  )                 
y = FirstClass(  )                 

x.setdata("A")               
y.setdata(3.14159)           
x.display(  )                
y.display(  ) 
x.data = "New value"               
x.display(  )                
x.anothername = "spam"








11.10.Instance
11.10.1.Instantiation: Creating Instances by Invoking Class Object
11.10.2.__del__() "Destructor" Method
11.10.3.Determining Instance Attributes
11.10.4.Object interaction
11.10.5.Instance Objects Are Concrete Items