[Python-ideas] Proposed addtion to urllib.parse in 3.1 (and urlparse in 2.7)

Mart Sõmermaa mrts.pydev at gmail.com
Mon Mar 30 12:55:28 CEST 2009


On Mon, Mar 30, 2009 at 1:28 PM, Eric Smith <eric at trueblade.com> wrote:

> "**" converts the parameters to an ordinary dict. The caller does not
> receive the same object you call the function with. So any ordering of the
> values in the odict will be lost.


Right you are, sorry for the mental blunder. So what if the signature is as
follows to support passing query parameters via an ordered dict:

add_query_params(url, params_dict=None, **kwargs)

with the following behaviour:

>>> pd = odict()
>>> pd['a'] = 1
>>> pd['b'] = 2
>>> add_query_params('http://foo.com/?a=0', pd, a=3)
'http://foo.com/?a=0&a=1&b=2&a=3'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090330/406e8314/attachment.html>


More information about the Python-ideas mailing list