Issue #25822: Add docstrings to the fields of urllib.parse results.

Patch contributed by Swati Jaiswal.
This commit is contained in:
Senthil Kumaran 2016-01-14 00:11:39 -08:00
parent 4e280a6f9f
commit 86f7109dad
2 changed files with 68 additions and 2 deletions

View File

@ -224,8 +224,71 @@ class _NetlocResultMixinBytes(_NetlocResultMixinBase, _ResultMixinBytes):
from collections import namedtuple from collections import namedtuple
_DefragResultBase = namedtuple('DefragResult', 'url fragment') _DefragResultBase = namedtuple('DefragResult', 'url fragment')
_SplitResultBase = namedtuple('SplitResult', 'scheme netloc path query fragment') _SplitResultBase = namedtuple(
_ParseResultBase = namedtuple('ParseResult', 'scheme netloc path params query fragment') 'SplitResult', 'scheme netloc path query fragment')
_ParseResultBase = namedtuple(
'ParseResult', 'scheme netloc path params query fragment')
_DefragResultBase.__doc__ = """
DefragResult(url, fragment)
A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
"""
_DefragResultBase.url.__doc__ = """The URL with no fragment identifier."""
_DefragResultBase.fragment.__doc__ = """
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
"""
_SplitResultBase.__doc__ = """
SplitResult(scheme, netloc, path, query, fragment)
A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
"""
_SplitResultBase.scheme.__doc__ = """Specifies URL scheme for the request."""
_SplitResultBase.netloc.__doc__ = """
Network location where the request is made to.
"""
_SplitResultBase.path.__doc__ = """
The hierarchical path, such as the path to a file to download.
"""
_SplitResultBase.query.__doc__ = """
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
"""
_SplitResultBase.fragment.__doc__ = """
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
"""
_ParseResultBase.__doc__ = """
ParseResult(scheme, netloc, path, params, query, fragment)
A 6-tuple that contains components of a parsed URL.
"""
_ParseResultBase.scheme.__doc__ = _SplitResultBase.scheme.__doc__
_ParseResultBase.netloc.__doc__ = _SplitResultBase.netloc.__doc__
_ParseResultBase.path.__doc__ = _SplitResultBase.path.__doc__
_ParseResultBase.params.__doc__ = """
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
"""
_ParseResultBase.query.__doc__ = _SplitResultBase.query.__doc__
_ParseResultBase.fragment.__doc__ = _SplitResultBase.fragment.__doc__
# For backwards compatibility, alias _NetlocResultMixinStr # For backwards compatibility, alias _NetlocResultMixinStr
# ResultBase is no longer part of the documented API, but it is # ResultBase is no longer part of the documented API, but it is

View File

@ -128,6 +128,9 @@ Core and Builtins
Library Library
------- -------
- Issue #25822: Add docstrings to the fields of urllib.parse results.
Patch contributed by Swati Jaiswal.
- Issue #22642: Convert trace module option parsing mechanism to argparse. - Issue #22642: Convert trace module option parsing mechanism to argparse.
Patch contributed by SilentGhost. Patch contributed by SilentGhost.