title: Parse custom URIs with urlparse (Python)
body: <p>My application creates custom URIs (or URLs?) to identify objects and resolve them. The problem is that Python's urlparse module refuses to parse unknown URL schemes like it parses http.</p>
  
  <p>If I do not adjust urlparse's uses_* lists I get this:</p>
  
  <pre><code>&gt;&gt;&gt; urlparse.urlparse("qqqq://base/id#hint")
  ('qqqq', '', '//base/id#hint', '', '', '')
  &gt;&gt;&gt; urlparse.urlparse("http://base/id#hint")
  ('http', 'base', '/id', '', '', 'hint')
  </code></pre>
  
  <p>Here is what I do, and I wonder if there is a better way to do it:</p>
  
  <pre><code>import urlparse
  
  SCHEME = "qqqq"
  
  # One would hope that there was a better way to do this
  urlparse.uses_netloc.append(SCHEME)
  urlparse.uses_fragment.append(SCHEME)
  </code></pre>
  
  <p>Why is there no better way to do this?</p>