[Web-SIG] wsgi.url_vars feedback

Ian Bicking ianb at colorstudy.com
Wed Nov 1 19:48:38 CET 2006


Robert Brewer wrote:
> Ian Bicking wrote:
>> One little question: if a dispatcher can never produce
>> one of the kinds of information (which happens for some
>> of them), should they put in an empty list/tuple or
>> empty dict, or should they put in None for that item?
>> I'm currently saying they must put in a list/tuple or dict.
> 
> and I replied:
>> I would've thought they'd just leave out the entry altogether.
> 
> and Ian answered:
>> You can't omit something from a two-tuple; it would become
>> ambiguous one-tuple of course!
> 
> Of course. I didn't read your proposal well enough, I guess.
> 
> But it still begs the question: if you expect various dispatchers can
> never produce either args or kwargs, then why not go with a pair of
> independent entries: wsgi.dispatch_args and wsgi.dispatch_kwargs? That
> would make the omission of one or the other much more natural for both
> the sender and receiver.

I thought briefly about that.  Maybe I should have thought more about 
it; the little dance I had to do to merge both positional and keyword 
arguments into a tuple is a little silly (in the regex example in the 
spec).  It does feel conceptually good to treat them as a combined 
whole.  But conversely, if I was to expose these keys directly through a 
request object I'd do it as two separate attributes, because the tuple 
is awkward to work with.


-- 
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org


More information about the Web-SIG mailing list