How to get the class instance of a passed method ?

Stef Mientki stef.mientki at gmail.com
Thu Nov 20 18:16:37 EST 2008


hello,

if I pass a class method to a function,
is it possible to determine the class instance in that  function ?

class test ( object ) :
  def My_Method ( self ) :
    return 22

def do_something ( parameter ) :
  # here I want to determine My_Instance

My_Instance = test ()
do something ( My_Instance.My_Method )


thanks
Stef Mientki



More information about the Python-list mailing list