All pastes #467299 Raw Edit

tarek

public python v1 · immutable
·published 2007-05-02 13:15 UTC
rendered paste body
>>> class F(object):...     def t(self):...         print 'coucou'... >>> def u():...     print 'coucou'... >>> def get_instance(func):...     if not hasattr(func, 'im_self'):...         return None...     return func.im_self... >>> get_instance(u)>>> get_instance(g.t)<__main__.F object at 0x6c630>