use the cls parameter of the classmethod

This commit is contained in:
Thomas Weißschuh
2014-09-26 23:30:35 +00:00
parent 5a604ce0a8
commit 46ff5a4dae

View File

@@ -69,11 +69,10 @@ class URIReference(namedtuple('URIReference', URI_COMPONENTS)):
uri_string = to_str(uri_string, encoding)
split_uri = URI_MATCHER.match(uri_string).groupdict()
return URIReference(split_uri['scheme'], split_uri['authority'],
encode_component(split_uri['path'], encoding),
encode_component(split_uri['query'], encoding),
encode_component(split_uri['fragment'], encoding),
encoding)
return cls(split_uri['scheme'], split_uri['authority'],
encode_component(split_uri['path'], encoding),
encode_component(split_uri['query'], encoding),
encode_component(split_uri['fragment'], encoding), encoding)
def authority_info(self):
"""Returns a dictionary with the ``userinfo``, ``host``, and ``port``.