title: Comparing two urls in Python
body: <p>Is there a standard way to compare two urls in Python - that implements <code>are_url_the_same</code> in this example:</p>
  
  <pre><code>url_1 = 'http://www.foo.com/bar?a=b&amp;c=d'
  url_2 = 'http://www.foo.com:80/bar?c=d;a=b'
  
  if are_urls_the_same(url_1, url2):
      print "URLs are the same"
  </code></pre>
  
  <p>By the same I mean that they access the same resource - so the two urls in the example are the same.</p>