parameterized classes

Fredrik Lundh fredrik at pythonware.com
Thu Jul 24 03:53:31 EDT 2008


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 slot" test, though, so I hope someone else will have time 
to untangle it for you.

> And I may be dense, so if there is an easier way to stream sockets as 
> line streams, please let me know. I honestly don't think it should be 
> this difficult to implement a socket handler this simple.

there's a StreamRequestHandler class in SocketServer that buffered 
streams via the rfile and wfile attributes.

</F>




More information about the Python-list mailing list