Dimitri Papadopoulos Orfanos <dimitri.papadopou...@gmail.com> added the comment:

I agree on avoiding a link to str.isspace() and defining "whitespace" instead.

However please note there are many de facto definitions of "whitespace". All of 
them must be documented - or at least the conceptual classes of "whitespace" 
and clarify which class each of the following belongs to:

* Unicode whitespaces are by very far the most common: str.isspace(), 
strip()/lstrip()/rstrip(), Py_UNICODE_ISSPACE.

* Py_ISSPACE targets byte/bytearray but is never used!

* bytearray.strip() does not use Py_ISSPACE but a hardcoded list of ASCII 
whitespaces instead.

* finally string.whitespace is probably equivalent to the list used by 
bytearray.strip().

Beyond the docs, I think Python 3 should rationalize bytearray.strip() /  
Py_ISSPACE / string.whitespace, probably having bytearray.strip() rely on 
Py_ISSPACE, and Py_ISSPACE rely on string.whitespace unless string.whitespace 
is obsoleted.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25433>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to