FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-37970: update and improve urlparse and urlsplit doc-strings by idomic · Pull Request #16458 · python/cpython · GitHub

Repository navigation

bpo-37970: update and improve urlparse and urlsplit doc-strings - #16458

Merged
taleinat merged 1 commit into
python:masterfrom
idomic:urlsplitDocString
Feb 16, 2020
Merged

taleinat merged 1 commit into
python:masterfrom
idomic:urlsplitDocString

Conversation

idomic commented Sep 28, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

idomic commented Oct 3, 2019

Copy link
Copy Markdown
Contributor Author

Hey @zware, would love to get feedback and close this PR.

Ido

zware commented Oct 3, 2019

Copy link
Copy Markdown
Member

Hi @idomic, sorry I haven't had time to get back to this yet. Some quick high-level feedback, though:

  • CI is failing, so that will need to be addressed. Without digging in and looking, the most likely culprit is trailing whitespace; run make patchcheck if you're on a *nix platform, or run the same commands that does if you're on Windows (yes, terrible UX there, sorry :( ).
  • There should be a NEWS entry for this, see the Details link on the bedevere/news check.
  • urlparse needs approximately the same treatment.
  • It would be good to go through the rest of the module and see if there are other similarly insufficient docstrings that could be updated while we're in there.

idomic commented Dec 3, 2019

Copy link
Copy Markdown
Contributor Author

@zware fixed all of the above 👍

zware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Still need to update urlparse as well.

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Updated :func:`urllib.parse.urlsplit` docstring.

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Copy Markdown
Contributor

@idomic, please address the review comments. Thanks!

idomic commented Feb 2, 2020

Copy link
Copy Markdown
Contributor Author

Thanks @zware @csabella and sorry for the delay!
Fixed the fixed the review comments, let's see if the CI passes.

idomic commented Feb 8, 2020 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Thanks @zware @csabella and sorry for the delay!
Fixed the fixed the review comments, let's see if the CI passes.

Added the documentation for the parseurl function as well.
@zware @csabella looks like everything passed fine?

codecov Bot commented Feb 8, 2020 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #16458 into master will increase coverage by 0.99%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master   #16458       +/-   ##
===========================================
+ Coverage   82.20%   83.20%    +0.99%     
===========================================
  Files        1958     1571      -387     
  Lines      589739   414730   -175009     
  Branches    44456    44456               
===========================================
- Hits       484793   345073   -139720     
+ Misses      95287    60016    -35271     
+ Partials     9659     9641       -18     
Impacted Files Coverage Δ
Lib/distutils/tests/test_bdist_rpm.py 30.00% <0.00%> (-65.00%) ⬇️
Lib/distutils/command/bdist_rpm.py 7.63% <0.00%> (-56.88%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-12.86%) ⬇️
Lib/ftplib.py 63.85% <0.00%> (-6.06%) ⬇️
Lib/test/test_ftplib.py 87.11% <0.00%> (-4.72%) ⬇️
Lib/dbm/__init__.py 66.66% <0.00%> (-4.45%) ⬇️
Tools/scripts/db2pickle.py 17.82% <0.00%> (-3.97%) ⬇️
Lib/test/test_socket.py 71.94% <0.00%> (-3.87%) ⬇️
Tools/scripts/pickle2db.py 16.98% <0.00%> (-3.78%) ⬇️
... and 428 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ed6161...82b2473. Read the comment docs.

csabella requested a review from zware February 9, 2020 18:41

idomic commented Feb 11, 2020

Copy link
Copy Markdown
Contributor Author

Hey @taleinat adding you to accelerate this PR

Copy link
Copy Markdown
Contributor

Hi @idomic,

It seems you've rebased your branch on a later commit on the master branch, and then merged that with the existing PR branch when pushing it.

For future reference, for PR branches, I highly recommend only merging rather than rebasing. If you have rebased, though, you should force-push the rebased branch (i.e. git push -f origin <branch-name>).

In this case, I suggest you (hard-) reset your branch to the commit before the merge, make sure it's okay, and then force-push that.

idomic commented Feb 11, 2020

Copy link
Copy Markdown
Contributor Author

Thanks @taleinat Done, let's see if the CI passes

Copy link
Copy Markdown
Contributor

@idomic, looks good now!

For future reference: Please leave a comment with the words I have made the requested changes; please review again after a committer has requested changes; this will trigger a bot to update the state tags and notify the reviewer.

taleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As mentioned by @zware, the suggested doc-strings don't follow the guidelines in PEP 257. In addition to my other comments, please fix their formatting.

Comment thread Lib/urllib/parse.py Outdated
Comment on lines 370 to 372

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is implied directly by the previous sentence, since this is the major feature of named tuples. IMO it would be better to omit this extra sentence. (Same goes for urlsplit() below.)

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy/paste error here: This returns a ParseResult object.

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I find this first line less clear than the original (though it is technically correct.)

How about:

"""Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>

The result is a ParseResult object, which is a named 6-tuple with
fields corresponding to the above.

...

This then followed by the later description of the other input parameters and the final note regarding % escapes not being expanded.

(The same goes for urlsplit() as well.)

taleinat Feb 11, 2020 •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This PR changes the doc-strings, not "the documentation", which is what goes up to docs.python.org.

Also, IMO this doesn't warrant a NEWS entry, so it can and should be removed. I'm adding the skip news label to allow that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@idomic, please remove this file.

idomic commented Feb 12, 2020

Copy link
Copy Markdown
Contributor Author

@taleinat Thanks for all the feedback, I noticed I forgot the space line after the doc-string summary.
Did took your version as it clarifies the role in less lines.

idomic commented Feb 12, 2020

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

Copy link
Copy Markdown

Thanks for making the requested changes!

@taleinat, @zware: please review the changes made to this pull request.

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This will actually be a ParseResult or a ParseResultBytes object, depending on the type of the url parameter. It will never be a SplitResult object.

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This will actually be a SplitResult or a SplitResultBytes object, depending on the type of the url parameter.

Comment thread Lib/urllib/parse.py Outdated
Comment thread Lib/urllib/parse.py Outdated
Comment thread Lib/urllib/parse.py Outdated
Comment thread Lib/urllib/parse.py Outdated

taleinat left a comment •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Almost done! Two more comments, relevant to both doc-strings.

(Also please remove the NEWS entry file.)

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The parameter is named "url" rather than "URL", let's keep the correct spelling.

Suggested change
depending on the type of the URL parameter.
depending on the type of the url parameter.

Comment thread Lib/urllib/parse.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How about, rather than this and the previous paragraphs being separate, something like:

"The result is a named 6-tuple with fields corresponding to the above. It is either a ParseResult or a ParseResultBytes object, depending on the type of the URL parameter."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's shorter, changed to this version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@idomic, please remove this file.

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

idomic commented Feb 13, 2020

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

Copy link
Copy Markdown

Thanks for making the requested changes!

@zware, @taleinat: please review the changes made to this pull request.

idomic commented Feb 14, 2020

Copy link
Copy Markdown
Contributor Author

@taleinat Should I just cherry pick and create a new PR? I see some of the ci fails even after pulling from the master latest version

taleinat commented Feb 16, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

@idomic, please don't create a new PR, and there's no need. What you should do is:

  1. Hard-reset your branch to the latest master branch
  2. Make the latest appropriate changes (even copy-paste from GitHub works)
  3. Review, making sure everything is fine
  4. run make patchcheck (or run patchcheck.py directly on Windows)
  5. Create a new commit with appropriate prefix: [bpo-37970](https://bugs.python.org/issue37970):
  6. Force-push into this PR's branch

idomic commented Feb 16, 2020 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Thanks @taleinat , I have made the requested changes; please review again
Let's see how it goes!

Copy link
Copy Markdown

Thanks for making the requested changes!

@taleinat, @zware: please review the changes made to this pull request.

Copy link
Copy Markdown
Contributor

@idomic, it seems something went very wrong on your end with this PR's branch. I've gone ahead and force-pushed a fixed version, with a single commit.

If you want to check it out locally, note that you'll need to delete your local branch (or rename it to back it up) before pulling this branch.

taleinat changed the title bpo-37970 Fixed urlsplit docstrings in urllib/parse.py bpo-37970: update and improve urlparse and urlsplit doc-strings Feb 16, 2020

Copy link
Copy Markdown
Contributor

Many thanks for the PR, @idomic, and for your patience repeatedly waiting for a review and making the requested changes!

I assure you that for changes such as this, it usually doesn't take this long nor as many iterations as it took us here. I hope this experience doesn't discourage you from continuing to contribute to the project!

idomic commented Feb 16, 2020

Copy link
Copy Markdown
Contributor Author

@taleinat Not at all, I'm happy to learn and help!
Hopefully our next work will be more concise :)

idomic deleted the urlsplitDocString branch February 16, 2020 20:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL