Re: parameterized classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Lundh

    Re: parameterized classes

    John Tantalo wrote:
    I really wish I could create a class whose instances were classes that
    subclassed BaseRequestHand ler. 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 StreamRequestHa ndler class in SocketServer that buffered
    streams via the rfile and wfile attributes.

    </F>

  • Michele Simionato

    #2
    Re: parameterized classes

    John Tantalo wrote:
    I really wish I could create a class whose instances were classes that
    subclassed BaseRequestHand ler. Is this possible, or is there a better
    way than my approach here? Or am I crazy?
    You may use type:

    type('MuSubclas s', (Base, ), dict(a1=1, a2=2, ...))

    Comment

    Working...