@@ -2012,13 +2012,19 @@ expression support in the :mod:`re` module).
20122012
20132013.. method :: str.isprintable()
20142014
2015- Return ``True `` if all characters in the string are printable or the string is
2016- empty, ``False `` otherwise. Nonprintable characters are those characters defined
2017- in the Unicode character database as "Other" or "Separator", excepting the
2018- ASCII space (0x20) which is considered printable. (Note that printable
2019- characters in this context are those which should not be escaped when
2020- :func: `repr ` is invoked on a string. It has no bearing on the handling of
2021- strings written to :data: `sys.stdout ` or :data: `sys.stderr `.)
2015+ Return true if all characters in the string are printable, false if it
2016+ contains at least one non-printable character.
2017+
2018+ Here "printable" means the character is suitable for :func: `repr ` to use in
2019+ its output; "non-printable" means that :func: `repr ` on built-in types will
2020+ hex-escape the character. It has no bearing on the handling of strings
2021+ written to :data: `sys.stdout ` or :data: `sys.stderr `.
2022+
2023+ The printable characters are those which in the Unicode character database
2024+ (see :mod: `unicodedata `) have a general category in group Letter, Mark,
2025+ Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space 0x20.
2026+ Nonprintable characters are those in group Separator or Other (Z or C),
2027+ except the ASCII space.
20222028
20232029
20242030.. method :: str.isspace()
0 commit comments