kann mir mal jemand folgendes Verhalten erklären:
Code: Alles auswählen
In [13]: class Test(object):
....: def __init__(self, foo):
....: self.foo = foo
....:
....: def get_foo(self):
....: return self.foo
....:
....:
In [14]: def test():
....: print 'bar'
....:
....:
In [15]: def call_it(call):
....: call()
....:
....:
In [16]: t = Test('bar')
In [17]: t.get_foo()
Out[17]: 'bar'
In [18]: call_it(t.get_foo)
In [19]: call_it(test)
barmutetella
