Re: parameterized classes

2008-07-24 Thread Michele Simionato
John Tantalo wrote: > I really wish I could create a class whose instances were classes that > subclassed BaseRequestHandler. Is this possible, or is there a better > way than my approach here? Or am I crazy? You may use type: type('MuSubclass', (Base, ), dict(a1=1, a2=2, ...)) -- http://mail.pyt

Re: parameterized classes

2008-07-24 Thread Fredrik Lundh
John Tantalo wrote: Is there is a better way to create parameterized classes than defining and returning a class in a closure? I ask because I want to create arbitrary BaseRequestHandler subclasses that delegate line handling to a given line handler, as in this example: Oh, now I get it

Re: parameterized classes

2008-07-24 Thread Fredrik Lundh
John Tantalo wrote: I really wish I could create a class whose instances were classes that subclassed BaseRequestHandler. Is this possible, or is there a better way than my approach here? Or am I crazy? no you so much as your code. unfortunately, it fails the "decipher in allocated time slo

parameterized classes

2008-07-24 Thread John Tantalo
Is there is a better way to create parameterized classes than defining and returning a class in a closure? I ask because I want to create arbitrary BaseRequestHandler subclasses that delegate line handling to a given line handler, as in this example: from SocketServer import * class