<br><br><div class="gmail_quote">On Mon, Mar 30, 2009 at 2:28 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Mart Sõmermaa wrote:<br>
> Right you are, sorry for the mental blunder. So what if the signature is<br>
> as follows to support passing query parameters via an ordered dict:<br>
><br>
> add_query_params(url, params_dict=None, **kwargs)<br>
><br>
> with the following behaviour:<br>
><br>
>>>> pd = odict()<br>
>>>> pd['a'] = 1<br>
>>>> pd['b'] = 2<br>
>>>> add_query_params('<a href="http://foo.com/?a=0" target="_blank">http://foo.com/?a=0</a>', pd, a=3)<br>
</div>> '<a href="http://foo.com/?a=0&a=1&b=2&a=3" target="_blank">http://foo.com/?a=0&a=1&b=2&a=3</a> <<a href="http://foo.com/?a=0&a=1&b=2&a=3" target="_blank">http://foo.com/?a=0&a=1&b=2&a=3</a>>'<br>
<br>
When setting up a dict.update style interface like that, it is often<br>
better to use *args for the two positional arguments - it avoids<br>
accidental name conflicts between the positional arguments and arbitrary<br>
keyword arguments.</blockquote><div><br>Thanks, another good point.<br></div></div>