-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-106318: Improve str.lower() docs #144848
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2437,6 +2437,20 @@ expression support in the :mod:`re` module). | |
| >>> 'Lower Method Example'.lower() | ||
| 'lower method example' | ||
|
|
||
| Note that ``s.lower().islower()`` might be ``False`` if ``s`` | ||
| contains uncased characters or if the Unicode category of the resulting | ||
| character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter, | ||
| titlecase). | ||
|
|
||
| For example, see the word "Python" written in Punjabi, the most spoken | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think the fact is particularly interesting nor helpful, I think it just unnecessarily extends the section.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean the whole adding or only the example? The note paragraph was based on what already exists in the str.upper() docs. If this exists there, I think it makes sense exist here too. The example I've suggested adds to str.upper() docs on #144638. I would prefer a more Occidental example, but I couldn't find one. I think examples are important.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was referring to specifically the "most spoken language in..." fact.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was referring to specifically the "most spoken language in..." fact.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, nice. I've put it because if I see only "written in Punjabi", I would think "wtf is Punjabi?". Of course, I would search about that, but I thought it could be ended here. That being said, we can:
What do you prefer? |
||
| language in Pakistan: | ||
|
|
||
| .. doctest:: | ||
|
|
||
| >>> 'ازگر'.lower().islower() | ||
| False | ||
|
|
||
|
|
||
| The lowercasing algorithm used is `described in section 3.13.2 'Default Case | ||
| Conversion' of the Unicode Standard | ||
| <https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G34078>`__. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.