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
16 changes: 14 additions & 2 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,14 @@ expression support in the :mod:`re` module).
intended to remove all case distinctions in a string. For example, the German
lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already
lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
converts it to ``"ss"``.
converts it to ``"ss"``, as follows:
Copy link
Member

Choose a reason for hiding this comment

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

I find this is a little repetitive, if one reads the sentence the example just repeats the exact same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if we remove the sentence and put comments?

>>> 'ß'.casefold() # the German lowercase letter ``'ß'``
'ss'
>>> 'ß'.lower() # since it is already lowercase, lower does nothing
'ß'


.. doctest::

>>> 'ß'.casefold()
'ss'
>>> 'ß'.lower()
'ß'

The casefolding algorithm is `described in section 3.13.3 'Default Case
Folding' of the Unicode Standard
Expand Down Expand Up @@ -2250,7 +2257,12 @@ expression support in the :mod:`re` module).
.. method:: str.lower()

Return a copy of the string with all the cased characters [4]_ converted to
lowercase.
lowercase. For example:

.. doctest::

>>> 'Lower Method Example'.lower()
'lower method example'

The lowercasing algorithm used is `described in section 3.13.2 'Default Case
Conversion' of the Unicode Standard
Expand Down
Loading