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
17 changes: 17 additions & 0 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2247,17 +2247,34 @@ expression support in the :mod:`re` module).
>>> '\t'.isprintable(), '\n'.isprintable()
(False, False)

See also :meth:`isspace`.


.. method:: str.isspace()

Return ``True`` if there are only whitespace characters in the string and there is
at least one character, ``False`` otherwise.

For example:

.. doctest::

>>> ''.isspace()
False
>>> ' '.isspace()
True
>>> '\t\n'.isspace() # TAB and BREAK LINE
True
>>> '\u3000'.isspace() # IDEOGRAPHIC SPACE
True

A character is *whitespace* if in the Unicode character database
(see :mod:`unicodedata`), either its general category is ``Zs``
("Separator, space"), or its bidirectional class is one of ``WS``,
``B``, or ``S``.

See also :meth:`isprintable`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the reference to isprintable here (and the reference to isspace in the docs on isprintable as well).



.. method:: str.istitle()

Expand Down
Loading