Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1d4b35f

Browse files
author
Victor Stinner
committed
rephrase PyUnicode_1BYTE_KIND documentation
1 parent fb9ea8c commit 1d4b35f

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Include/unicodeobject.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,14 @@ typedef struct {
296296
- PyUnicode_1BYTE_KIND (1):
297297
298298
* character type = Py_UCS1 (8 bits, unsigned)
299-
* if ascii is 1, at least one character must be in range
300-
U+80-U+FF, otherwise all characters must be in range U+00-U+7F
299+
* if ascii is set, all characters must be in range
300+
U+0000-U+007F, otherwise at least one character must be in range
301+
U+0080-U+00FF
301302
302303
- PyUnicode_2BYTE_KIND (2):
303304
304305
* character type = Py_UCS2 (16 bits, unsigned)
305-
* at least one character must be in range U+0100-U+1FFFF
306+
* at least one character must be in range U+0100-U+FFFF
306307
307308
- PyUnicode_4BYTE_KIND (3):
308309
@@ -315,9 +316,9 @@ typedef struct {
315316
one block for the PyUnicodeObject struct and another for its data
316317
buffer. */
317318
unsigned int compact:1;
318-
/* kind is PyUnicode_1BYTE_KIND but data contains only ASCII
319-
characters. If ascii is 1 and compact is 1, use the PyASCIIObject
320-
structure. */
319+
/* The string only contains characters in range U+0000-U+007F (ASCII)
320+
and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is
321+
set, use the PyASCIIObject structure. */
321322
unsigned int ascii:1;
322323
/* The ready flag indicates whether the object layout is initialized
323324
completely. This means that this is either a compact object, or

0 commit comments

Comments
 (0)