class A(object):
class B(object):
def __getitem__(self, key):
# Obviously not the same self here...
x = self.function_A_needs_as_well(key)
def function_A_needs_as_well(self, value):
pass
Run Code Online (Sandbox Code Playgroud)
我希望这个例子不是太糟糕,至少有点自我解释.有人能告诉我如何从"B级"内部调用"function_A_needs_as_well"吗?
| 归档时间: |
|
| 查看次数: |
81 次 |
| 最近记录: |