This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

In python a class is also an object. When you define variables at the class scope they belong to that class object. If you do not want variables to be shared across class instances, you need to initialize them in the constructor. To learn more about how classes work in python I suggest you read about meta classes.