|
|
От: |
eugals
|
|
| Дата: | 23.05.09 08:55 | ||
| Оценка: | |||
FR>Traceback (most recent call last):
FR> File "hghghg.py", line 49, in <module>
FR> b.Foo()
FR> File "hghghg.py", line 46, in Foo
FR> A.Foo(self)
FR>TypeError: unbound method Foo() must be called with A instance as first argument (got B instance instead)
FR>>>> class A:
def foo(self):
print("A")
def call_foo(self):
self.foo()
>>> class B:
def foo(self):
print("B")
>>> A.call_foo(B())
B