summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-19 04:09:32 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-19 04:09:32 (GMT)
commit94303549c43b8fd54bfeee0a628f15e5bd125342 (patch)
tree4ba689d427682e2da1862b0531674ce09401e55f
parent391166fbfcdecc5c428db3d67242d1f1beb2b423 (diff)
downloadcpython-94303549c43b8fd54bfeee0a628f15e5bd125342.zip
cpython-94303549c43b8fd54bfeee0a628f15e5bd125342.tar.gz
cpython-94303549c43b8fd54bfeee0a628f15e5bd125342.tar.bz2
improve casefold/lower/upper docs
-rw-r--r--Doc/library/stdtypes.rst20
1 files changed, 18 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 8fba7b8..36b9068 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1005,7 +1005,16 @@ functions based on regular expressions.
.. method:: str.casefold()
Return a casefolded copy of the string. Casefolded strings may be used for
- caseless matching. For example, ``"MASSE".casefold() == "maße".casefold()``.
+ caseless matching.
+
+ Casefolding is similar to lowercasing but more aggressive because it is
+ 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"``.
+
+ The casefolding algorithm is described in section 3.13 of the Unicode
+ Standard.
.. versionadded:: 3.3
@@ -1217,6 +1226,9 @@ functions based on regular expressions.
Return a copy of the string with all the cased characters [4]_ converted to
lowercase.
+ The lowercasing algorithm used is described in section 3.13 of the Unicode
+ Standard.
+
.. method:: str.lstrip([chars])
@@ -1420,7 +1432,11 @@ functions based on regular expressions.
Return a copy of the string with all the cased characters [4]_ converted to
uppercase. Note that ``str.upper().isupper()`` 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).
+ character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
+ titlecase).
+
+ The uppercasing algorithm used is described in section 3.13 of the Unicode
+ Standard.
.. method:: str.zfill(width)