Staging
v0.8.1
https://github.com/python/cpython
Revision 8c1c426a631ba02357112657193f82c58d3e08b4 authored by Greg Price on 19 August 2019, 09:53:22 UTC, committed by Victor Stinner on 19 August 2019, 09:53:22 UTC
The documented definition was much broader than the real one:
there are tons of characters with general category "Other",
and we don't (and shouldn't) treat most of them as whitespace.

Rewrite the definition to agree with the comment on
_PyUnicode_IsWhitespace, and with the logic in makeunicodedata.py,
which is what generates that function and so ultimately governs.

Add suitable breadcrumbs so that a reader who wants to pin down
exactly what this definition means (what's a "bidirectional class"
of "B"?) can do so.  The `unicodedata` module documentation is an
appropriate central place for our references to Unicode's own copious
documentation, so point there.

Also add to the isspace() test a thorough check that the
implementation agrees with the intended definition.
1 parent 786a4e1
History
Tip revision: 8c1c426a631ba02357112657193f82c58d3e08b4 authored by Greg Price on 19 August 2019, 09:53:22 UTC
bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296)
Tip revision: 8c1c426
File Mode Size
clinic
stringlib
README -rw-r--r-- 41 bytes
abstract.c -rw-r--r-- 68.6 KB
accu.c -rw-r--r-- 2.4 KB
boolobject.c -rw-r--r-- 6.6 KB
bytearrayobject.c -rw-r--r-- 70.1 KB
bytes_methods.c -rw-r--r-- 21.1 KB
bytesobject.c -rw-r--r-- 99.5 KB
call.c -rw-r--r-- 36.2 KB
capsule.c -rw-r--r-- 7.3 KB
cellobject.c -rw-r--r-- 5.7 KB
classobject.c -rw-r--r-- 19.2 KB
codeobject.c -rw-r--r-- 34.1 KB
complexobject.c -rw-r--r-- 32.5 KB
descrobject.c -rw-r--r-- 58.4 KB
dict-common.h -rw-r--r-- 2.2 KB
dictnotes.txt -rw-r--r-- 6.0 KB
dictobject.c -rw-r--r-- 138.0 KB
enumobject.c -rw-r--r-- 13.4 KB
exceptions.c -rw-r--r-- 87.4 KB
fileobject.c -rw-r--r-- 16.8 KB
floatobject.c -rw-r--r-- 71.3 KB
frameobject.c -rw-r--r-- 32.8 KB
funcobject.c -rw-r--r-- 31.1 KB
genobject.c -rw-r--r-- 64.7 KB
interpreteridobject.c -rw-r--r-- 9.1 KB
iterobject.c -rw-r--r-- 9.2 KB
listobject.c -rw-r--r-- 97.6 KB
listsort.txt -rw-r--r-- 35.3 KB
lnotab_notes.txt -rw-r--r-- 5.7 KB
longobject.c -rw-r--r-- 175.5 KB
memoryobject.c -rw-r--r-- 91.3 KB
methodobject.c -rw-r--r-- 13.8 KB
moduleobject.c -rw-r--r-- 24.8 KB
namespaceobject.c -rw-r--r-- 7.4 KB
object.c -rw-r--r-- 61.8 KB
obmalloc.c -rw-r--r-- 87.4 KB
odictobject.c -rw-r--r-- 73.2 KB
picklebufobject.c -rw-r--r-- 6.0 KB
rangeobject.c -rw-r--r-- 34.6 KB
setobject.c -rw-r--r-- 73.1 KB
sliceobject.c -rw-r--r-- 19.1 KB
structseq.c -rw-r--r-- 14.5 KB
tupleobject.c -rw-r--r-- 31.2 KB
typeobject.c -rw-r--r-- 242.7 KB
typeslots.inc -rw-r--r-- 3.9 KB
typeslots.py -rwxr-xr-x 1.2 KB
unicodectype.c -rw-r--r-- 7.5 KB
unicodeobject.c -rw-r--r-- 460.5 KB
unicodetype_db.h -rw-r--r-- 246.9 KB
weakrefobject.c -rw-r--r-- 29.8 KB

README

back to top