[Web-SIG] Re: The rewritten WSGI pre-PEP

Phillip J. Eby pje at telecommunity.com
Wed Aug 11 18:57:30 CEST 2004


At 10:54 AM 8/11/04 -0500, Ian Bicking wrote:
>However, because the context could have a complex implementation, it would 
>be hard to rewrite the context if you forward the request.  OTOH, most of 
>the pieces of the context shouldn't be forwarded on.  For instance, if 
>mod_python gives access to the apache module, or the original request 
>object, should middleware pass through that access?  It would probably be 
>incorrect, as the middleware is doing some filtering and the mod_python 
>extensions would bypass that filtering.
>
>Which is to say, middleware shouldn't pass through extensions by default, 
>but with a dictionionary implementation it would be common to do so.

Actually, the idea behind the naming convention is that middleware can 
filter out extensions if it needs to.  It need only delete any lowercase 
key that doesn't begin with 'wsgi.' to remove all extensions, or it can be 
more specific, according to its needs.

I didn't actually mention this in the spec, though, so I'll need to fix that.


>One positive aspect of a dictionary is that introspection is easier. 
>There's no reliable equivalent of .keys() for an arbitrary object.
>
>And, if we package things into an object, environ could also become an 
>attribute of context.

I'm -1 on making an object out of it.  It will make the spec even longer 
than it already is, and it will increase the number of things to 
discuss.  (E.g. names of the methods).



More information about the Web-SIG mailing list