[docs] [issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

Mike Frysinger report at bugs.python.org
Thu Oct 19 15:24:20 EDT 2017


Mike Frysinger <vapier at users.sourceforge.net> added the comment:

specifically, the docs for these classes:
https://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlsplit
https://docs.python.org/3/library/urllib.parse.html#urlparse-result-object

> The result objects from the urlparse() and urlsplit() functions are subclasses
> of the tuple type. These subclasses add the attributes described in those
> functions, as well as provide an additional method:
> ...
> class urlparse.SplitResult(scheme, netloc, path, query, fragment)
>   Concrete class for urlsplit() results.

changing "subclasses of the tuple type" to "subclasses of collections.namedtuples" would be great.  also adding hints to use _replace to update values would be great :).

----------
nosy: +vapier

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31822>
_______________________________________


More information about the docs mailing list