How can I define class methods outside of the class?

Jeremy jlconlin at gmail.com
Thu Dec 2 00:36:32 EST 2010


I have some methods that I need (would like) to define outside of the
class.  I know this can be done by defining the function and then
setting it equal to some member of an instance of the class.  But,
because of the complexity of what I'm doing (I have to set many
functions as class methods) I would rather not do this.  Can someone
show me how to do this?  Is it even possible?  Can decorators be used
here?

Thanks,
Jeremy



More information about the Python-list mailing list