how to make a code object a function

Diez B. Roggisch deets_noospaam at web.de
Sun Jan 4 08:11:22 EST 2004


Hi,

I've got code objects that are created from strings at runtime that look
like this:

def p_op1(_, args):
    _.add_dependency('p_op1')

As you migth guess, p_op1 is supposed to become an instance method. Now how
do I make this code object a function-object that can be set into the
instances __dict__ to make it a callable method? 

Thanks for any advice,

Diez B. Roggisch



More information about the Python-list mailing list