[Web-SIG] PEP222 and python on the server?

mso@oz.net mso at oz.net
Fri Jun 10 00:34:56 CEST 2005


WSGI is a protocol, not a specific function or class, so you can't put it
"in" the standard library.  But you can recommend it in the documentation.
And a wsgitools module a la itertools would certainly be useful.

Having used WSGI a bit with Paste and Quxiote, I'd say it's a better
common denominator than Request/Response objects.  We'll never agree on
the best Request/Response format, so people will be packing/unpacking it
to their preferred structure anyway -- exactly as they do with WSGI. 
Classes imply overhead, and you can't assume they'll be installed on
Python < 2.5.  WSGI uses only Python primitives so it can be used
anywhere.  Some of the more coloful ideological battles regarding
Request/Response:
  - Should the Response be inside the Request or separate?
  - Is .field('foo') an abomination or is .fields['foo'] more satanic?
  - Return the body or call a .write() method or...?

If certain actions are inconvenient in WSGI -- like modifying a response
header -- we can provide wrapper functions for these.  The biggest part in
this is identifying the actions.

The only limitation in WSGI I've found is you can't serialize it for IPC
since it contains an open file descriptor.  But others have argued SCGI is
more appropriate for this anyway.

-- 
-- Mike Orr <mso at oz.net>






More information about the Web-SIG mailing list