On Fri, Mar 27, 2009 at 6:13 PM, Bill Janssen <span dir="ltr"><<a href="mailto:janssen@parc.com">janssen@parc.com</a>></span> wrote:<br><div class="gmail_quote"><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 <<a href="mailto:mrts.pydev@gmail.com">mrts.pydev@gmail.com</a>> wrote:<br>
<br>
</div><div class="im">> Appending query parameters to a URL is a very common need. However, there's<br>
> nothing in urllib.parse (and older urlparse) that caters for that need.<br>
><br>
> Therefore, I propose adding the following to 2.7 and 3.1 in the respective<br>
> libs:<br>
<br>
</div><div class="im">>     >>> add_query_params('<a href="http://foo.com?a=b" target="_blank">http://foo.com?a=b</a>', b='c', d='q')<br>
<br>
</div>To begin with, I wouldn't use keyword params.  They're syntactically<br>
more restrictive than the rules for application/x-www-form-urlencoded<br>
allow, so you start by ruling out whole classes of URLs.<br>
<font color="#888888"><br>
Bill<br>
</font></blockquote></div><br>Valid point, using an ordinary dict instead would resolve that (i.e. def add_query_params(url, param_dict)).<br>