class factory example needed (long)

Gary Ruben gazzar at nospam_email.com
Thu Mar 3 07:16:07 EST 2005


Thanks Steven and Kent, both of your suggestions look good to me. I'll 
try both out and pick one.
Gary

Gary Ruben wrote:
> OK, I've managed to get this to work with Rainer's method, but I 
> realised it is not the best way to do it, since the methods are being 
> added by the constructor, i.e. they are instance methods. This means 
> that every time a foo object is created, a whole lot of code is being 
> run. It would be better to do the same thing with class 'static' 
> methods, if this is possible, so that the methods are created just once.
> Is this possible?
> Gary



More information about the Python-list mailing list