>>> class A(object):
... def some(self):
... pass
...
>>> a=A()
>>> a.some
<bound method A.some of <__main__.A object at 0x7f0d6fb9c090>>
IOW, ho bisogno di accedere a "a" dopo essere stato consegnato solo "a.some".Come trovare l'istanza di un metodo associato in Python?
Giusto per rendere del tutto chiaro: utilizzare questo se si dispone di Python 3. Se si sta utilizzando Python 2, l'equivalente è il 'im_self' che altri hanno scritto. –
@Thomas: funziona perfettamente per me in python2.x stabile – SilentGhost
Errore mio, non leggerei la risposta con sufficiente attenzione. –