-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
GH-90829: Fix empty iterable error message in min/max #31181
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
GH-90829: Fix empty iterable error message in min/max #31181
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
5321ba4
to
581c5a9
Compare
I am curious as to the @invalid-email-address issue. I definitely have a bpo account with my GitHub user name, Nnarol associated. Another thing that confuses me is why The third thing: is Windows essentially really required to contribute? The Adobe sign thingy used for signing the CLA says either Windows or Mac OS. Thanks in advance to anyone who can help! |
I haven't reviewed this closely, but I agree with the basic idea. The phrasing "empty sequence" is 32 years old! It predates the iterator protocol, so it makes sense to change since iterators are expected. Line 280 in 3f5da24
It looks like this PR is currently set to changes some files (freeze_modules.py and support/__init__.py) unrelated to the central change. It would be preferable to revert those so the PR is more focused and the git history is more clear. |
e819301
to
4637e0f
Compare
@sweeneyde Thanks for your reply! At least I know that the changes to those 2 files |
Change misleading "empty sequence" to "empty iterable" in builtins.min/max. Update corresponding test to be more specific and match the error string.
4637e0f
to
6802cfc
Compare
Misc/NEWS.d/next/Core and Builtins/2022-02-07-17-40-23.bpo-46671.CmpNlQ.rst
Outdated
Show resolved
Hide resolved
…71.CmpNlQ.rst Spelling fix in RST documentation. Co-authored-by: Nikita Sobolev <[email protected]>
@sobolevn Thanks! |
Misc/NEWS.d/next/Core and Builtins/2022-02-07-17-40-23.bpo-46671.CmpNlQ.rst
Outdated
Show resolved
Hide resolved
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.
Looks good, but I think you'll have to resign the CLA under our new procedure, sorry for that!
@JelleZijlstra Under the following related issue: another core developer, @rhettinger deemed the change not readable, and the issue was closed. Are you sure this one should proceed? |
Raymond doesn't have a monopoly on approving or rejecting changes, and on this thread @sweeneyde also agreed with the premise of this change. I'll leave this open for a little while to give others a chance to provide feedback or suggest better wording. |
No news entries are needed for minor docs fixes.
Every change to Python requires a NEWS entry. Please, add it using the blurb_it Web app or the blurb command-line tool. |
Hi @JelleZijlstra and @rhettinger ! Since the RST file was deleted as it is unnecessary for documentation changes, the respective automated check now fails. I assume this does not technically prevent a merge, right? |
I didn't have a strong concern on this one, so go ahead and proceed :-) Normally though, if a core developer objects to a change, there needs to be a discussion rather than trampling their concern. This is especially true for a senior dev who is more familiar the norms and history of the project. This also helps newer devs learn how to handle nuance and establishes a better community norm than "I got someone else to give a thumbs up, so I can just ignore you." Also, we tend to place more weight on no votes so that if a change is questionable, the status quo wins. The history of this particular issue is that sometimes we have elected to use the word sequence as general understandable English that than iterable which is more type specific. Python isn't just used by typing experts, it is also used by kids, high school students, and non-IT professionals. Overtime the word iterable have become better understood by day-to-day Python users, so the bar is much lower. Still, in some places we still save "sequence (or other iterable)" for clarity. Since this is just an error message, changing it is fine. |
@rhettinger As a new developer, I find your reasoning very sensible, which is why I mentioned your concerns here.
In fact, to my knowledge, there is a general term that corresponds to the more type system-specific iterable, namely collection, which I've seen in various contexts involving Python and does not express anything about ordering, as opposed to sequence. EDIT: Thinking back, however, I think I have never seen "collection" used in actual Python code or error messages. |
I should have worded my previous message better, but I didn't merge the PR or express an intent to merge it, so that's hardly "trampling". I do agree that we should default to the status quo if there's no clear consensus, but I feel strongly that we should give the discussion a chance to run its course before closing attempts to fix a perceived problem. So let's go back to discussing the best wording for this error message.
I do see the concern, but "iterable" is already pervasive in error messages (for example, In this case, "iterable" is the right ABC to use. @Nnarol suggested "collection", but the |
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.
LGTM, iterable
term is better as it aligns with the ABCs and existing error messages.
>>> tuple(42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
>>>
Change misleading "empty sequence" to "empty iterable" in builtins.min/max.
Update corresponding test to be more specific and match the error string.
https://bugs.python.org/issue46671