[Twisted-web] HTTPChannel class attributes

A Desai ardesai at yahoo.com
Sat Oct 6 02:46:27 EDT 2012

Should http.py :: HTTPChannel.__first_line be an instance attribute instead of a class attribute?

I have a custom scenario where I sub-classed HTTPChannel for my sub-classed HTTPFactory.  In the DerivedHTTPChannel class I overrode the allContentReceived() method.

I recently enabled persistent connections, but setting self.__first_line = 1 in the DerivedHTTPChannel was ineffective, and the first line of the next request threw an exception when it got parsed as an http header.  Similar question "probably" apply to other class attributes.

Should such attributes be instance attributes instead of class attributes? Or is it anticipated that any class who derives from HTTPChannel should override almost all the methods of the base class?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20121005/9ff96000/attachment.htm 

More information about the Twisted-web mailing list