我如何或可以执行以下操作?请注意,虽然我声明了 b_class,但我并不总是直接实例化 b_class,而是由库实例化。
class a_class:
def some_method(self):
"""
get the class instance of b_class in which a_class is instantiated
using that instance, get var1
perform some action based on var1
"""
class b_class:
var1 = "init by the constructor or a method"
a_inst = a_class()
"""
other attributes
"""