Adding new member variables to python objects?
问题 I have started reading the "Beginning python from novice to professional" by Magnus Lie Hetland, and what struck me today is an ability of an objects to create new member variables, even though those member variables were not present in the class from which the object was "created". Here is an example: class Test: pass b = Test() b.variable1 = 12 b.variable2 = "Jim" print b.variable1 print b.variable2 Until now I though that objects could only change the member values present in parent class,