mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
This commit is contained in:
commit
a7c781724f
2 changed files with 50 additions and 7 deletions
|
@ -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 |
|
||||
+------------------+-------+-------------------------+----------------------+
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue