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

Fredrik Lundh fredrik at pythonware.com
Wed Aug 11 19:15:16 CEST 2004


Phillip J. Eby wrote:

>>Advantages:
>>- contexts can (probably) be reused
>>- attributes can be lazily initialized (via properties or getattr hooks)
>>- the user code looks nicer
>>- future safe: more attributes and methods can be added to the context
>>   object in future revisions of this specification, without changing the
>>   function signatures
>
> All of these advantages also apply to an object supplied in the dictionary, i.e.:
>
>     environ['some_server.context'] = context_object

that's obviously not true: environment dictionaries cannot be reused,
environment items cannot be lazily initialized (since you require apps
to use a PyDict), and the code using WSGI variables has to use dict
access syntax (x["y"]) instead of standard attribute access (x.y).

> The advantage is simplicity of implementation.  It's possible to write middleware (application 
> that's also a server) without creating any new classes.

so "def a(b)" is easy to write, but "class a" is hard to write?

you're obviously not interested in feedback from experienced Python
programmers.  I'm sorry I wasted everybody's time.

</F> 





More information about the Web-SIG mailing list