summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-06-25 20:38:48 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-06-25 20:38:48 (GMT)
commit89584c97e44b7cc7ca782e8e4c668b0647147f24 (patch)
treefd7eea20c34c6cbac54d69d7599c4ef8f3118999 /Doc
parent1096f761b67b2286ac2ab7b8989dc0e0b5a54a96 (diff)
downloadcpython-89584c97e44b7cc7ca782e8e4c668b0647147f24.zip
cpython-89584c97e44b7cc7ca782e8e4c668b0647147f24.tar.gz
cpython-89584c97e44b7cc7ca782e8e4c668b0647147f24.tar.bz2
Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
Diffstat (limited to 'Doc')
-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 154a521..fbbabca 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 |
+------------------+-------+-------------------------+----------------------+