Skip to content

Conversation

@cbkinase
Copy link
Contributor

@cbkinase cbkinase commented Oct 19, 2025

The glossary currently states:

“the str.lower() method can serve as a key function for case-insensitive sorts.”

I believe this should be updated to use str.casefold() instead. str.casefold() is recommended for case-insensitive matching in Unicode, and it provides more accurate behavior across languages than str.lower(). This also aligns with the "Sorting Techniques" section of the docs, which uses str.casefold() as the key function for case-insensitive sorting.


📚 Documentation preview 📚: https://cpython-previews--140316.org.readthedocs.build/

…str.lower

The glossary currently states:

“the str.lower() method can serve as a key function for case-insensitive sorts.”

I believe this should be updated to use str.casefold() instead.
str.casefold() is recommended for case-insensitive matching in Unicode, and it provides more accurate behavior across languages than str.lower(). This also aligns with the "Sorting Techniques" section of the docs, which uses str.casefold() as the key function for case-insensitive sorting.
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Oct 19, 2025
@python-cla-bot
Copy link

python-cla-bot bot commented Oct 19, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@hugovk hugovk merged commit 190aa9f into python:main Dec 16, 2025
40 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Dec 16, 2025
@hugovk hugovk added awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Dec 16, 2025
@miss-islington-app
Copy link

Thanks @cbkinase for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @cbkinase for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 16, 2025
…str.lower (pythonGH-140316)

(cherry picked from commit 190aa9f)

Co-authored-by: Cameron Beck <94604154+cbkinase@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 16, 2025
…str.lower (pythonGH-140316)

(cherry picked from commit 190aa9f)

Co-authored-by: Cameron Beck <94604154+cbkinase@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 16, 2025

GH-142806 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 16, 2025
@bedevere-app
Copy link

bedevere-app bot commented Dec 16, 2025

GH-142807 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 16, 2025
hugovk pushed a commit that referenced this pull request Dec 16, 2025
…ead of str.lower (GH-140316) (#142807)

Co-authored-by: Cameron Beck <94604154+cbkinase@users.noreply.github.com>
hugovk pushed a commit that referenced this pull request Dec 16, 2025
…ead of str.lower (GH-140316) (#142806)

Co-authored-by: Cameron Beck <94604154+cbkinase@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants