#NEWLINE# def method_func( klass , method_name ) : #NEWLINE# #INDENT# "\n    Get the function object from a class and a method name.\n\n    In Python 2 doing getattr(SomeClass, 'methodname') returns an\n    instancemethod and in Python 3 a function. Use this helper to reliably get\n    the function object\n    " #NEWLINE# method = getattr ( klass , method_name ) #NEWLINE# return getattr ( method , '__func__' , method )