I'm having a bit of a dilemma with Python nested classes. What i'm trying to do is get variables from a function at the top level of class A and use them in the sub class B. Something like this
class A:
def function_A():
value = 5
class B:
def function_B(self):
print (A.value)
This method below works if i turn the variable into a class variable like below but it doesn't do what i want:
class A:
value = 5
class B:
def function_B(self):
print (A.value)
I'm guessing that this isn't possible so can anyone provide a workaround?