Как вызвать класс из функции?
Помогите пожалуйста решить такую задачу. В классе А в функции Afun2_1 нужно вызвать класс B из функции Afun1
class A:
def __init__(self):
self.B_cls = B()
self.C_cls = C()
def Afun1(self, a, b, c):
class B:
def __init_(self, a, b, d):
self.a = a
self.b = b
self.d = d
def Bfun1(self):
"""something colculation"""
return """solution 'Bfun1'"""
class C:
def __init__(self, f, g, h):
self.f = f
self.g = g
self.h = h
def Afun1_1(self):
"""something colculation"""
def Afun2(self, a, e):
def Afun2_1(a, l):
"""something colculation"""
**"""And here for colculation, I need to get 'class B'. How to do it ? """**
return """solution 'Afun2_1'"""
Источник: Stack Overflow на русском