[Web-SIG] Pre-PEP: Python Web Container Interface v1.0

A.M. Kuchling amk at amk.ca
Sun Dec 7 16:35:21 EST 2003


On Sun, Dec 07, 2003 at 01:53:43PM -0500, Phillip J. Eby wrote:
> to a request made on a Web server.  A container invokes an application
> by calling its ``runCGI`` method, whose signature is defined as

Name nit: why include the irrelevant 'CGI' in the name?  Just 'run()' would
be fine.

> Containers that can run multiple requests in parallel, *should* also
> provide the option of running an application in a single-threaded
> fashion, so that applications or frameworks that are not thread-safe
> may still be used.

Should there also be a is_thread_safe() method that returns a Boolean, 
so containers can serialize if necessary?  

> The rationale for requiring a dictionary is to maximize portability
> between containers.  The alternative would be to define here some
> subset of a dictionary's methods as being the standard and portable
> interface.  In practice, however, most containers will probably want

Note that the UserDict.DictMixin class implements all of the other
dictionary methods as long as you implement __getitem__, __setitem__,
__delitem__, and keys().  It seems unpythonic to require a particular class
here.

The spec looks very good, though -- simple, easy to implement, and useful.

--amk



More information about the Web-SIG mailing list