Defining class methods outside of classes

Lord Landon lordlandon at gmail.com
Wed May 3 17:42:34 EDT 2006


Hi, I'm working on a bot written in python. It will consist of a
mostly empty class that will then call a loader which in turn defines
functions and adds them to the class. At the moment, I do this by
using execfile(file,globals()) and calling a load(bot) method defined
in every "module" which takes the functions defined in that perticular
module and does bot.function=function. The problem with that is when I
call bot.function() self doesn't get passed as an argument to the
function. Is there anything I can do to sort this besides calling
bot.function(bot, ...) everytime?

--
Lord Landon rules over all!



More information about the Python-list mailing list