'URL object with the individual parts available as attributes:
For protocol://username:password@domain:port/path/page?query_string#anchor:
- URL.protocol: http, https, ftp, ...
- URL.username: username for restricted domains.
- URL.password: password for restricted domains.
- URL.domain  : the domain name, e.g. nodebox.net.
- URL.port    : the server port to connect to.
- URL.path    : the server path of folders, as a list, e.g. [\'news\', \'2010\']
- URL.page    : the page name, e.g. page.html.
- URL.query   : the query string as a dictionary of (name, value)-items.
- URL.anchor  : the page anchor.
If method is POST, the query string is sent with HTTP POST.'

def __init__(self, string=u'', method=GET, query={}, **kwargs):

    self.__dict__['method'] = method
    self.__dict__['_string'] = u(string)
    self.__dict__['_parts'] = None
    self.__dict__['_headers'] = None
    self.__dict__['_redirect'] = None
    if isinstance(string, URL):
        self.__dict__['method'] = string.method
        self.query.update(string.query)
    if (len(query) > 0):
        self.query.update(query)
    if (len(kwargs) > 0):
        self.parts.update(kwargs)
