New submission from Terry J. Reedy:

On Windows, 3.3 socketserver defines 12 classes in 3 categories: servers, 
server mixins, and handlers. (At least, these are the one listed with 
dir(socketserver). Only BaseServer is indexed. I think all should be. There are 
also a couple of text issues.

BaseServer - indexed, doc is 20.19.2. Server Objects

TCPServer - mentioned in diagram and text of 20.19.1
UDPServer - ditto
(I presume *nix version have unixxxx classes also)

ForkingMixIn - text of 20.19.1
ThreadingMixIn - ditto

ForkingTCPServer
ForkingUDPServer
ThreadingTCPServer
ThreadingUDPServer

Text says "Forking and threading versions of each type of server can be created 
using the ForkingMixIn and ThreadingMixIn mix-in classes. For instance, a 
threading UDP server class is created as follows:
  class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
The mix-in class must come first, since it overrides a method defined in 
UDPServer."

"can be" means to me that user must create these. I am guessing that 
pre-defining them was added later. So text should change to 'have been'. The 
pre-created combinations should be listed. The last sentence could then say 
"Thhe mix-in class comes first since it overrides...". 

---
BaseRequestHandler

This is documented in 20.19.2 RequestHandler Objects. But instead of starting 
with something like

class socketserver.BaseRequestHandler 
This is the superclass of all RequestHandler objects. It defines the interface, 
given below, but does not implement most of the methods, which is done in 
subclasses. A new instance of the subclass is created for each request.

analogous to the initial entry in 20.19.1, 20.19.2 starts with

"The request handler class must define a new handle() method, and can override 
any of the following methods. A new instance is created for each request.

I suggest that this be replaced with a standard class entry like the one above. 
If done, I resume the "RequestHandler" method prefix should be 
"BaseRequestHandler".

StreamRequestHandler - these two are described in a paragraph
DatagramRequestHandler - after the handle method entry

---
In summary:
1. index all classes to point to locations indicated above.
2. state that mixin combinations are pre-defined.
3. give BaseRequestHandler a proper entry.
4. revise above as needed for *nix.
5. optionally adjust as needed for 2.7.

----------
assignee: docs@python
components: Documentation
messages: 167825
nosy: docs@python, terry.reedy
priority: normal
severity: normal
status: open
title: Improve socketserver doc
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15608>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to