urllib.parse docstrings incomplete #82151
Copy link
Copy link
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2019-08-28.16:26:39.687>
labels = ['easy', '3.8', '3.9', '3.7', 'library', 'docs']
title = 'urllib.parse docstrings incomplete'
updated_at = <Date 2020-02-23.23:22:55.138>
user = 'https://github.com/zware'bugs.python.org fields:
activity = <Date 2020-02-23.23:22:55.138>
actor = 'Ido Michael'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Library (Lib)']
creation = <Date 2019-08-28.16:26:39.687>
creator = 'zach.ware'
dependencies = []
files = []
hgrepos = []
issue_num = 37970
keywords = ['patch', 'newcomer friendly']
message_count = 16.0
messages = ['350668', '350798', '351116', '351135', '351137', '351145', '351338', '353446', '361776', '361777', '361779', '362094', '362096', '362102', '362536', '362550']
nosy_count = 7.0
nosy_names = ['orsenthil', 'taleinat', 'docs@python', 'zach.ware', 'nanjekyejoannah', 'syadlapalli', 'Ido Michael']
pr_nums = ['16458', '18631']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue37970'
versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Projects
- StatusShow more project fieldsDone
Activity
zware commentedon Aug 28, 2019
For example, urlsplit:
The current docstring does not describe the
schemeorallow_fragmentsarguments. Also, the note about not splitting netloc is misleading; the components of netloc (username, password, hostname, and port) are available as extra attributes of the returned SplitResult.urlparse has similar issues; other functions could stand to be checked.
nanjekyejoannah commentedon Aug 29, 2019
Also, the docs in urllib.parse.rst should also be updated to correct this misleading statement.
tmblweed commentedon Sep 4, 2019
hello!
I can see that we might want to add documentation for splitting netloc, but I don't understand why we'd have scheme and netloc, but nothing for path and query. What are you suggesting we add for scheme/allow_fragements?
Thanks!
zware commentedon Sep 4, 2019
I'm not sure what you mean here; can you please clarify?
Just a brief description of what effect the arguments actually have on the returned result.
tmblweed commentedon Sep 4, 2019
I guess what I'm wondering is this:
We don't have details regarding anything, i.e scheme, netloc, path or query or fragments. So I was curious about why we would have more documentation around netloc and scheme and nothing about path and query
Should we be adding information for all(scheme, netloc, path, query, fragment) of them, including extra attributes of the returned SplitResult?
p.s - newbie trying to contribute here
zware commentedon Sep 4, 2019
I see. I don't think we need to describe each returned component in the docstring; they're some combination of self-explanatory, described in the reference docs, or just industry-standard terms that are easily defined from other sources. I'm not suggesting to add anything to the docstring about the
schemereturn component, but rather the scheme argument (which is the default value for theschemereturn component when it's not found in the url). The subcomponents of netloc should be mentioned because the docstring currently gives the impression that the user has to parse them out for themselves, which is not true.Off the top of my head, I'd suggest changing the
urlsplitdocstring to something like:tmblweed commentedon Sep 8, 2019
got it - thanks for the detailed explanation! I'll go ahead and create a PR soon
idomic commentedon Sep 28, 2019
Committed a PR: #60662
I've read all of the thread and changed the docstring to the latest suggestion by @zach.ware
Ido
11 remaining items
pranavchoudhary-tech commentedon Jul 3, 2026
Hi, since the original PR #18631 has been marked as stale and the author gave permission to take it over, I would like to pick this up and apply the final requested changes!
orsenthil commentedon Jul 3, 2026
pythongh-82151: Update and improve urlsplit docstring
gh-82151: Update and improve urlsplit docstring (#152985)
[3.14] gh-82151: Update and improve urlsplit docstring (#152985) (#15…
[3.15] gh-82151: Update and improve urlsplit docstring (GH-152985) (#…
[3.13] gh-82151: Update and improve urlsplit docstring (#152985) (#15…