我有以下外部-内部类方案:
class Outer:
def __init__(self,x): self.x = x
class Inner:
def __init__(self, **kwargs): self.params = kwargs
def func(self): # Here, somehow, I need x
含义..
呼叫将像这样:Outer(10).Inner().func()
上面的语句应打印10
。
注意:
pickle
是必需的)pickle
使用函数(对吗?)以上情况是否可能?