Difference between instance attributes and class attributes
问题 I'm trying to learn about the instance and class attributes in python. Then am a little confused: is this_obj.var an instance attribute or it belongs to the class attribute. The code is below class Myclass (object): var = 10 this_obj = Myclass() this_obj.somevar = 12 that_obj = Myclass() that_obj.somevar = 12 回答1: Instance and class attributes can be kind of confusing to understand at first. The best way of thinking about it is to pay attention to the name. Instance attributes are owned by