Skip to content

Commit 5e5d557

Browse files
pranavchoudhary-techidomicorsenthil
committed
gh-82151: Update and improve urlsplit docstring (#152985)
Co-authored-by: idomic <michael.ido@gmail.com> Slightly improved wording for % escapes. Consistent with rest of the doc. --------- Co-authored-by: idomic <michael.ido@gmail.com> Co-authored-by: Senthil Kumaran <senthil@python.org> (cherry picked from commit ad54b91)
1 parent c6f5a73 commit 5e5d557

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Doc/library/urllib.parse.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,18 @@ or on combining URL components into a URL string.
5656
:class:`SplitResult` or :class:`SplitResultBytes`.
5757
This corresponds to the general structure of a URL:
5858
``scheme://netloc/path?query#fragment``.
59-
Each tuple item is a string, possibly empty. The components are not broken up
60-
into smaller parts (for example, the network location is a single string), and %
61-
escapes are not expanded. The delimiters as shown above are not part of the
62-
result, except for a leading slash in the *path* component, which is retained if
63-
present. For example:
59+
Each tuple item is a string, possibly empty.
60+
61+
The delimiters as shown above are not part of the result, except for a
62+
leading slash in the *path* component, which is retained if present.
63+
64+
Additionally, the netloc property is broken down into these additional
65+
attributes added to the returned object: username, password, hostname, and
66+
port.
67+
68+
Percent-encoded sequences are not decoded.
69+
70+
For example:
6471

6572
.. doctest::
6673
:options: +NORMALIZE_WHITESPACE

0 commit comments

Comments
 (0)