-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-32297: Few misspellings found in Python source code comments. #4803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to change function name for the sake of correct spelling. It shouldn't affect any other code and looks like tests aren't failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay since it won't affect anything else, and test can run as it is.
|
Hmm, the fixes here are for internal comments, not docstrings or documentation. I'm thinking these should be left as is, unless we are actually fixing those parts of the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mike, thank you for adding Python to the list of projects you contribute to. I presume you carefully checked the changes yourself. I double-checked and all look correct. Although not public, they make the code nicer to read.
I am the maintainer of idlelib, which is a special case, in that I even backport changes like this. So I will make the 3 changes in a separate patch and then revert them on this PR. IE, I will do the change I am requesting. Edit: Done #4807, #4809
I believe Mariatta's concern is about code churn and blame history. I will let everyone else decide what to do with non-idlelib changes.
Though each change is trivial, there are enough that I would have preferred that you started with a tracker issue. But I don't care now.
Test name changes should not affect anything else. If the test were my test (in idle_test), I would accept the name change, but it is not, so I leave it to the import people.
|
Thank you, Terry. Yes, I agree that it's might be good to open an Issue and discuss whether or not we should merge this request (partially or entirely). Mariatta, you are 100% correct, most of the changes are internal code comments, except one docstring (https://github.com/python/cpython/pull/4803/files#diff-be61682fc3333d3bd8fc466a4e4dbdcfR1261). And I completely agree with you that it might be useful, in some cases, to not touch git blame history. I think, at this moment, it's up for maintainers to decline or approve this changes, and I am open to exclude any of them from this request. |
|
Can you open an issue @mehanig on bugs.python.org and edit the title to reference it so we can decide if we want to accept your PR? |
|
Yes, done. Sorry for my late reply. |
|
@Mariatta: "Hmm, the fixes here are for internal comments, not docstrings or documentation. I'm thinking these should be left as is, unless we are actually fixing those parts of the code." @terryjreedy: "I believe Mariatta's concern is about code churn and blame history. I will let everyone else decide what to do with non-idlelib changes." IMHO it's ok to fix typos :-) But I didn't review the change itself. I asked @csabella and @CuriousLearner to take a look. |
|
Yeah well, it makes me uneasy when a PR touched 41 different files. |
Ah right, we have to backport this PR to Python 3.6 if we choose to merge it, to reduce conflicts when backporting fixes into Python 3.6. I propose to not backport it to Python 2.7, since Python 2.7 is dying and minor fixes are no more backported to 2.7. |
CuriousLearner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the spell fixes in comment and test cases are okay, since it won't affect other parts.
On the other hand, I agree that it may cause some issue in back-porting it to 3.6.
Apart from that, I have just minor comments on things. If this change is merged in, it would change the git blame for those lines, so it makes sense to do these changes too.
Lib/test/test_logging.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're fixing this sentence. I would suggest to also leave a space between # and the first word for the sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. I even fixed all the other places in this file. Otherwise, it might look very inconsistent. I'm talking about this last commit 53592fc, but it might be overhead and I'm open to revert it.
Lib/test/test_math.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the comments on the same line as code, please leave 2 spaces before starting the comment.
If we choose to change the git blame for this line, then it makes sense to fix as much as we can :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done in e2321c9
|
I agree with @CuriousLearner 's suggestions and the other changes LGTM. If it helps, 26 of the 41 file changes are for test files, so I don't know if the blame history is as important on those. Some of the changes to code files are ones that have been modified a few times this year, like asyncio, http, os, xml, and faulthandler.c. Maybe the maintainers of those should make individual decisions for blame, while the rest of the module changes might not be happen often enough to worry about the history. |
|
#4839 for asyncio typos |
|
@asvetlov Thank you. Is it correct, that I need now to exclude from this request the changes you picked? |
|
Just merge master branch from upstream |
CuriousLearner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes you did till
e2321c9, LGTM.
I don't think changes done in 53592fc are necessary.
Since we were fixing typos in previous comments, it made sense to also correctly format the comments.
The module owner can take a decision if the diff in 53592fc is really needed :)
Thanks for your work :)
|
@CuriousLearner Good! Yes, I'm also not sure about the last one :) |
53592fc to
af35990
Compare
|
FYI I approve of the importlib test changes. |
Lib/idlelib/autocomplete_w.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it looks like the PR is introducing a typo. Did something go wrong with the separate idlelib change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, my bad, incorrect rebase. Since current master already merged that changes separately, I now excluded idlelib revert-patches from this request.
af35990 to
b58b67b
Compare
|
Sorry, @mehanig and @asvetlov, I could not cleanly backport this to |
|
Thanks! |
|
@mehanig: Can you please backport your fix to Python 3.6? The backport will prevent conflicts when other changes will have to be backported. |
|
Backport to 3.6 has merge conflicts, let's not touch the branch. |
Please review previous comments starting near: This PR must be backported to Python 3.6. @mehanig (or someone else) can easily fix conflicts. |
…s. (pythonGH-4803) * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py. (cherry picked from commit 53f7a7c)
|
Ok, I did it: #4864 |
…s. (pythonGH-4803) * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py. (cherry picked from commit 53f7a7c)
|
@asvetlov Thank you so much for your help! |
I've extracted all the comments from
*.pyfiles and re-read them manually with the help of spelling and grammar tools.Most of the changes are a misspelling or something like incorrect editing. I wasn't expected to touch intentionally any other files except
*.py, but while searching through codebase found few mistakes also.And, few files are antique (10+ years), so I feel very nervous touching that part of the Python history.
https://bugs.python.org/issue32297