[docs] [issue25433] whitespace in strip()/lstrip()/rstrip()

Dimitri Papadopoulos Orfanos report at bugs.python.org
Mon Jan 4 05:06:11 EST 2016


Dimitri Papadopoulos Orfanos added the comment:

In Python 3 the situation is similar:
* The Py_UNICODE_ISSPACE macro is used internally to define str.isspace() and wherever Python needs to detect "whitespace" characters in strings.
* There is an equivalent function Py_ISSPACE for bytes/bytearray.
* The bytearray.strip() implementation for bytearray relies on hardcoded ASCII whitespaces instead of Py_ISSPACE.
* string.whitespace is a list of "ASCII whitespace characters" carved in stone. As far as I can see string.whitespace is defined but not used anywhere in Python source code.

Therefore I suggest the documentation of Python 3 points to str.isspace() wherever the term "whitespace" is used in any documentation related to strings - including this specific case of strip()/lstrip()/rstrip().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25433>
_______________________________________


More information about the docs mailing list