I'm trying to write a module that contains multiple classes. I want the same variable name in every class but want the values to be different. So that every definition will use the variable defined in the top of its own class.
For example:
class assign():
global a , b
a = 1
b = 2
def aa(x):
return a*x
class assign1():
global a, b
a = 5
b = 10
def aa(x) :
return a*x
This Produces:
print(assign.aa(3))
=15
print(assign1.aa(3))
=15
The global values aren't switch between the different classes and I would like them to be.
globalif you want the variables to be different?selfin there somewhere as they're not decorated withstaticmethodor anything of the like...