Re: [Tutor] metaclass question

2007-01-24 Thread Kent Johnson
Kim Branson wrote: > Hi, > > what i've ended up doing is the following > > define a EmpiricalScore class that has all the methods for computing > results > > define a single method in the evaluation class that is called > Score. This method simply walks though a list and executes the > m

Re: [Tutor] metaclass question

2007-01-23 Thread Kim Branson
Hi, what i've ended up doing is the following define a EmpiricalScore class that has all the methods for computing results define a single method in the evaluation class that is called Score. This method simply walks though a list and executes the methods in that list. There may be one

Re: [Tutor] metaclass question

2007-01-22 Thread Kent Johnson
Kim Branson wrote: > Hi i'm interested in implementing a factoryclass in python > > What i'd like to do is have my factoryClass produce an instance of a > class with some methods defined in arguments to the factory class. > > The classes that are produced have many common methods, but a single

Re: [Tutor] metaclass question

2007-01-22 Thread Alan Gauld
"Kim Branson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi i'm interested in implementing a factoryclass in python > > What i'd like to do is have my factoryClass produce an instance of a > class with some methods defined in arguments to the factory class. > > The classes that

Re: [Tutor] metaclass question

2007-01-22 Thread Andreas Kostyrka
Technically, you don't need metaclasses probably: class A(object): def methA(self, abc): pass def methB(self, def, ghi): pass def defaultMethod(self): raise UnknownMethodError() def __init__(self, methodName): self._calc = getattr(self, "meth%s" % me