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

gh-106318: Improve str.lower() docs by adorilson · Pull Request #144848 · python/cpython · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 14 additions & 0 deletions Doc/library/stdtypes.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 for instance "Lt" (Letter,
titlecase).

For example, see the word "Python" written in Punjabi, the most spoken

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

I don’t think the fact is particularly interesting nor helpful, I think it just unnecessarily extends the section.

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

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.

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

I was referring to specifically the "most spoken language in..." fact.

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

I was referring to specifically the "most spoken language in..." fact.

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

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:

  1. Keep it (in case you change your mind)
  2. Reduce to "written in Punjabi, a language from Paskitan"
  3. Reduce more to "written in Punjabi"
  4. 3 + adding a link to the Punjabi Wikipedia entry.

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>`__.
Expand Down
Loading

Back | FazBrowse Home | New Git URL