summaryrefslogtreecommitdiff
path: root/Doc/library/urllib.parse.rst
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-06-25 23:39:26 +0300
committerBerker Peksag <berker.peksag@gmail.com>2015-06-25 23:39:26 +0300
commita7c781724f32bbc659894e5e1ee9f7f18d1252c6 (patch)
tree835265e85cd19ca63394fc9e7b7ce46027a74808 /Doc/library/urllib.parse.rst
parente79f3557cc82f54e9b6b95143b4619b9ad33dccc (diff)
parent89584c97e44b7cc7ca782e8e4c668b0647147f24 (diff)
downloadcpython-git-a7c781724f32bbc659894e5e1ee9f7f18d1252c6.tar.gz
Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
Diffstat (limited to 'Doc/library/urllib.parse.rst')
-rw-r--r--Doc/library/urllib.parse.rst16
1 files changed, 9 insertions, 7 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index 800f8301c6..40098d0496 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -76,13 +76,15 @@ or on combining URL components into a URL string.
ParseResult(scheme='', netloc='', path='help/Python.html', params='',
query='', fragment='')
- If the *scheme* argument is specified, it gives the default addressing
- scheme, to be used only if the URL does not specify one. The default value for
- this argument is the empty string.
+ The *scheme* argument gives the default addressing scheme, to be
+ used only if the URL does not specify one. It should be the same type
+ (text or bytes) as *urlstring*, except that the default value ``''`` is
+ always allowed, and is automatically converted to ``b''`` if appropriate.
If the *allow_fragments* argument is false, fragment identifiers are not
- recognized and parsed as part of the preceding component. The default value
- for this argument is :const:`True`.
+ recognized. Instead, they are parsed as part of the path, parameters
+ or query component, and :attr:`fragment` is set to the empty string in
+ the return value.
The return value is actually an instance of a subclass of :class:`tuple`. This
class has the following additional read-only convenience attributes:
@@ -90,7 +92,7 @@ or on combining URL components into a URL string.
+------------------+-------+--------------------------+----------------------+
| Attribute | Index | Value | Value if not present |
+==================+=======+==========================+======================+
- | :attr:`scheme` | 0 | URL scheme specifier | empty string |
+ | :attr:`scheme` | 0 | URL scheme specifier | *scheme* parameter |
+------------------+-------+--------------------------+----------------------+
| :attr:`netloc` | 1 | Network location part | empty string |
+------------------+-------+--------------------------+----------------------+
@@ -206,7 +208,7 @@ or on combining URL components into a URL string.
+------------------+-------+-------------------------+----------------------+
| Attribute | Index | Value | Value if not present |
+==================+=======+=========================+======================+
- | :attr:`scheme` | 0 | URL scheme specifier | empty string |
+ | :attr:`scheme` | 0 | URL scheme specifier | *scheme* parameter |
+------------------+-------+-------------------------+----------------------+
| :attr:`netloc` | 1 | Network location part | empty string |
+------------------+-------+-------------------------+----------------------+