Instance variables vs. class variables in Python

I have Python classes, of which I need only one instance at runtime, so it would be sufficient to have the attributes only once per class and not per instance. If there would be more than one instance (which won’t happen), all instance should have the same configuration. I wonder which of the following options would be better or more “idiomatic” Python.

class variables is shared across all instances in python?

I started coding in python a week ago, it is my mistake i started coding using oops,classes and objects that soon. I assumed my C++ proficiency will help…. I got bit by the following code class A: var=0 list=[] def __init__(self): pass Here to my surprise, var and list are kinda global variable, it is … Read more