Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9430354

Browse files
committed
improve casefold/lower/upper docs
1 parent 391166f commit 9430354

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

Doc/library/stdtypes.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,16 @@ functions based on regular expressions.
10051005
.. method:: str.casefold()
10061006

10071007
Return a casefolded copy of the string. Casefolded strings may be used for
1008-
caseless matching. For example, ``"MASSE".casefold() == "maße".casefold()``.
1008+
caseless matching.
1009+
1010+
Casefolding is similar to lowercasing but more aggressive because it is
1011+
intended to remove all case distinctions in a string. For example, the German
1012+
lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already
1013+
lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
1014+
converts it to ``"ss"``.
1015+
1016+
The casefolding algorithm is described in section 3.13 of the Unicode
1017+
Standard.
10091018

10101019
.. versionadded:: 3.3
10111020

@@ -1217,6 +1226,9 @@ functions based on regular expressions.
12171226
Return a copy of the string with all the cased characters [4]_ converted to
12181227
lowercase.
12191228

1229+
The lowercasing algorithm used is described in section 3.13 of the Unicode
1230+
Standard.
1231+
12201232

12211233
.. method:: str.lstrip([chars])
12221234

@@ -1420,7 +1432,11 @@ functions based on regular expressions.
14201432
Return a copy of the string with all the cased characters [4]_ converted to
14211433
uppercase. Note that ``str.upper().isupper()`` might be ``False`` if ``s``
14221434
contains uncased characters or if the Unicode category of the resulting
1423-
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter, titlecase).
1435+
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
1436+
titlecase).
1437+
1438+
The uppercasing algorithm used is described in section 3.13 of the Unicode
1439+
Standard.
14241440

14251441

14261442
.. method:: str.zfill(width)

0 commit comments

Comments
 (0)