mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
resize_copy() now supports legacy ready strings
This commit is contained in:
parent
488fa49acf
commit
7a9105a380
2 changed files with 19 additions and 13 deletions
|
@ -220,6 +220,7 @@ typedef struct {
|
|||
- compact ascii:
|
||||
|
||||
* structure = PyASCIIObject
|
||||
* test: PyUnicode_IS_COMPACT_ASCII(op)
|
||||
* kind = PyUnicode_1BYTE_KIND
|
||||
* compact = 1
|
||||
* ascii = 1
|
||||
|
@ -231,6 +232,7 @@ typedef struct {
|
|||
- compact:
|
||||
|
||||
* structure = PyCompactUnicodeObject
|
||||
* test: PyUnicode_IS_ASCII(op) && !PyUnicode_IS_COMPACT(op)
|
||||
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
|
||||
PyUnicode_4BYTE_KIND
|
||||
* compact = 1
|
||||
|
@ -247,6 +249,7 @@ typedef struct {
|
|||
- legacy string, not ready:
|
||||
|
||||
* structure = PyUnicodeObject
|
||||
* test: kind == PyUnicode_WCHAR_KIND
|
||||
* length = 0 (use wstr_length)
|
||||
* hash = -1
|
||||
* kind = PyUnicode_WCHAR_KIND
|
||||
|
@ -262,6 +265,7 @@ typedef struct {
|
|||
- legacy string, ready:
|
||||
|
||||
* structure = PyUnicodeObject structure
|
||||
* test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND
|
||||
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
|
||||
PyUnicode_4BYTE_KIND
|
||||
* compact = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue