Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Doc/library/stdtypes.rst
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
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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:

  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