On Tue, Nov 24, 2009 at 4:16 PM, Sylvain Hellegouarch <s...@defuze.org> wrote:
> I'm not aware of any problems with representing the request with a >> dictionary. Can you give examples? >> > > Though it shouldn't be considered as a problem, the fact that probably no > existing framework actually use the raw dictionary (there is, in almost all > cases, a wrapping into a friendlier object), one might wonder why keeping > such a low level interface rather than directly provide a higher level > interface is a good idea. After all creating those dictionaries for no good > reason aside from sending them to the next layer which will map them into a > WebOb, a yaro, a cherrypy request, or zope request, etc. seems slightly > pointless (I'm not versed into Python internals, but doesn't it have also a > cost of creating rather useless objects repeatedly like that?) I know WSGI > tries hard not to force into one implementation but still... > Well, that's hardly a trivial requirement, nor a trivial accomplishment. Also the dictionary is a complete and inspectable representation of the environment, divorced from any possible trickery on the part of frameworks. It's a common gateway between servers and frameworks, and can be used as a gateway between middleware and applications. And it's really fairly common for middleware to use the raw dictionary without any object involved. -- Ian Bicking | http://blog.ianbicking.org | http://topplabs.org/civichacker
_______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com