Strange effect with import
Jens Thoms Toerring
jt at toerring.de
Thu Dec 20 20:12:17 EST 2012
Terry Reedy <tjreedy at udel.edu> wrote:
> > server = SocketServer.TCPServer((192.168.1.10, 12345), ReqHandler)
> >
> > where ReqHandler is the name of a class derived from
> > SocketServer.BaseRequestHandler
> You misunderstood the doc. You pass the class, not the name of the class.
> From 21.19.4.1. socketserver.TCPServer Example
> server = socketserver.TCPServer((HOST, PORT), MyTCPHandler)
Yes, I meant "the class", but I'm a bit weak on nomenclature in
Python;-)
> > A new instance of this class is gernerated for each connection
> > request to the server. In the call that creates the server I can
> > only specify the name of the class but no arguments to be passed
> Code those arguments directly into the handle method of your version of
> MyTCPhandler. Or if you need to override multiple methods and use the
> same values in multiple methods, override __init__ and add self.x =
> x-value statements.
Sorry, you lost me there: what means "code those arguments
directly into the handle method"? According to the documen-
tation (or at least to my understanding of it;-) the handle()
method is suppose to accept just one argument, 'self'. And
even if I would change the method to accept more arguments
and that wouldnt blow up into my face, where would they be
coming from (and from where would I pass them)?
Best regards, Jens
--
\ Jens Thoms Toerring ___ jt at toerring.de
\__________________________ http://toerring.de
More information about the Python-list
mailing list