class MyClass(Object):
def __init__(self, x=None):
if x:
self.x = x
def do_something(self):
print self.x
Now I have two objects
my_class1 = MyClass(x)
my_class2 = MyClass()
I want to use x when this my_class2 object is called
As other languages Support static variable like java,c++ etc.
Assign it as property to the class: