On 11/8/06, Sylvain Hellegouarch <[EMAIL PROTECTED]> wrote: > Luke Arno wrote: > > I see that Ian has marked the proposed routing args > > convention as accepted. I have updated selector and > > now consider it a stable feature so feel free to use it. > > > > http://wsgi.org/wsgi/Specifications/routing_args > > https://lukearno.com/projects/selector/ > > > > Hello there, > > Sorry for being so late into the discussion. I must say I like that > proposal and I completely sedond it. Except for one small point, the > spec says: > > "The values in routing_args need not be strings (except for the keys of > named_args). For instance, a dispatcher is allowed to parse > /archive/2005/10/01 into ((), {'date': datetime.date(2005, 10, 1)})." > > This could be an issue for deployment if we consider that applications > or other middleware will not be able to know what a middleware that > implements this proposal has decided to do, map the values or not. > > Say I have the value '00001' in my URI, I don't want the dispatcher to > assume it's an int and maps it to '1'. Maybe this value is an identifier > for me and I need the complete value. There is a loss of information. > > What I would like to add to the proposal if it's not too late is the > mean to tell the middleware whether or not I agree that it maps values > automatically. > > Say: > > s = Selector(allow_mapping=False) > > Or something equivlent. > > Personally I would in fact disable that feature altogether and let the > application decide what is best but I doubt you will appreciate that idea. > > In any case I will certainly use this proposal in the WSGI dispatcher of > Amplee, my APP implementation. > > > http://trac.defuze.org/browser/oss/amplee/amplee/handler/store/wsgi/__init__.py >
Hi Sylvain, Selector does no coercion and I have the same preference. Everything comes through as strings. Some dispatch strategies do entail coercion and it is a hurdle to making dispatchees portable but I don't seen the routing_args convention being adopted if there was a restriction on types. I agree with you that it would be nice for any dispatch tool that does coercion to make it easy to turn off. Maybe we should annotate the spec? Cheers, - Luke _______________________________________________ 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