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

Skip to content

Commit c10abb4

Browse files
committed
Merged revisions 87443 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r87443 | alexander.belopolsky | 2010-12-22 21:58:25 -0500 (Wed, 22 Dec 2010) | 1 line Issue #10587: Document the meaning of str methods. ........
1 parent a79a676 commit c10abb4

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

Doc/library/stdtypes.rst

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -898,28 +898,36 @@ functions based on regular expressions.
898898
.. method:: str.isalnum()
899899

900900
Return true if all characters in the string are alphanumeric and there is at
901-
least one character, false otherwise.
901+
least one character, false otherwise. A character ``c`` is alphanumeric if one
902+
of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``,
903+
``c.isdigit()``, or ``c.isnumeric()``.
902904

903905

904906
.. method:: str.isalpha()
905907

906908
Return true if all characters in the string are alphabetic and there is at least
907-
one character, false otherwise.
909+
one character, false otherwise. Alphabetic characters are those characters defined
910+
in the Unicode character database as "Letter", i.e., those with general category
911+
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
912+
from the "Alphabetic" property defined in the Unicode Standard.
908913

909914

910915
.. method:: str.isdecimal()
911916

912917
Return true if all characters in the string are decimal
913918
characters and there is at least one character, false
914-
otherwise. Decimal characters include digit characters, and all characters
919+
otherwise. Decimal characters are those from general category "Nd". This category
920+
includes digit characters, and all characters
915921
that that can be used to form decimal-radix numbers, e.g. U+0660,
916922
ARABIC-INDIC DIGIT ZERO.
917923

918924

919925
.. method:: str.isdigit()
920926

921927
Return true if all characters in the string are digits and there is at least one
922-
character, false otherwise.
928+
character, false otherwise. Digits include decimal characters and digits that need
929+
special handling, such as the compatibility superscript digits. Formally, a digit
930+
is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal.
923931

924932

925933
.. method:: str.isidentifier()
@@ -931,7 +939,9 @@ functions based on regular expressions.
931939
.. method:: str.islower()
932940

933941
Return true if all cased characters in the string are lowercase and there is at
934-
least one cased character, false otherwise.
942+
least one cased character, false otherwise. Cased characters are those with
943+
general category property being one of "Lu", "Ll", or "Lt" and lowercase characters
944+
are those with general category property "Ll".
935945

936946

937947
.. method:: str.isnumeric()
@@ -940,7 +950,8 @@ functions based on regular expressions.
940950
characters, and there is at least one character, false
941951
otherwise. Numeric characters include digit characters, and all characters
942952
that have the Unicode numeric value property, e.g. U+2155,
943-
VULGAR FRACTION ONE FIFTH.
953+
VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property
954+
value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
944955

945956

946957
.. method:: str.isprintable()
@@ -957,8 +968,9 @@ functions based on regular expressions.
957968
.. method:: str.isspace()
958969

959970
Return true if there are only whitespace characters in the string and there is
960-
at least one character, false otherwise.
961-
971+
at least one character, false otherwise. Whitespace characters are those
972+
characters defined in the Unicode character database as "Other" or "Separator"
973+
and those with bidirectional property being one of "WS", "B", or "S".
962974

963975
.. method:: str.istitle()
964976

@@ -970,7 +982,9 @@ functions based on regular expressions.
970982
.. method:: str.isupper()
971983

972984
Return true if all cased characters in the string are uppercase and there is at
973-
least one cased character, false otherwise.
985+
least one cased character, false otherwise. Cased characters are those with
986+
general category property being one of "Lu", "Ll", or "Lt" and uppercase characters
987+
are those with general category property "Lu".
974988

975989

976990
.. method:: str.join(iterable)

0 commit comments

Comments
 (0)