peps: Address Victor's comments.

http://hg.python.org/peps/rev/5c69799e1a94 changeset: 3948:5c69799e1a94 user: Martin v. Löwis <martin@v.loewis.de> date: Wed Sep 28 00:08:51 2011 +0200 summary: Address Victor's comments. files: pep-0393.txt | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/pep-0393.txt b/pep-0393.txt --- a/pep-0393.txt +++ b/pep-0393.txt @@ -169,7 +169,7 @@ PyUnicode_FromUnicode remains supported but is deprecated. If the Py_UNICODE pointer is non-null, the data representation is set. If the pointer is NULL, a properly-sized wstr representation is allocated, -which can be modified until PyUnicode_Ready() is called (explicitly +which can be modified until PyUnicode_READY() is called (explicitly or implicitly). Resizing a Unicode string remains possible until it is finalized. @@ -192,10 +192,9 @@ - PyUnciode_READ(kind, data, index) - PyUnicode_WRITE(kind, data, index, value) - PyUnicode_READ_CHAR(unicode, index) - - PyUnicode_WRITE_CHAR(unicode, index, value) All these macros assume that the string is in canonical form; -callers need to ensure this by calling PyUnicode_FAST_READY. +callers need to ensure this by calling PyUnicode_READY. A new function PyUnicode_AsUTF8 is provided to access the UTF-8 representation. It is thus identical to the existing @@ -231,14 +230,13 @@ Other macros: - PyUnicode_READY(o) -- PyUnicode_CONVERT_BYTES(from_type, tp_type, begin, end, to) +- PyUnicode_CONVERT_BYTES(from_type, to_type, begin, end, to) String creation functions: - PyUnicode_New(size, maxchar) - PyUnicode_FromKindAndData(kind, data, size) - PyUnicode_Substring(o, start, end) -- PyUnicode_Chr(ch) Character access utility functions: @@ -265,8 +263,9 @@ The following functions are added to the stable ABI (PEP 384), as they are independent of the actual representation of Unicode objects: -PyUnicode_New, PyUnicode_Chr, PyUnicode_GetLength, PyUnicode_ReadChar, -PyUnicode_WriteChar, PyUnicode_Find, PyUnicode_FindChar. +PyUnicode_New, PyUnicode_Substring, PyUnicode_GetLength, +PyUnicode_ReadChar, PyUnicode_WriteChar, PyUnicode_Find, +PyUnicode_FindChar. GDB Debugging Hooks ------------------- @@ -286,6 +285,22 @@ deprecated API even in new code is for code that shall work both on Python 2 and Python 3. +The following macros and functions are deprecated: + +- PyUnicode_FromUnicode +- PyUnicode_GET_SIZE, PyUnicode_GetSize, PyUnicode_GET_DATA_SIZE, +- PyUnicode_AS_UNICODE, PyUnicode_AsUnicode, PyUnicode_AsUnicodeAndSize +- PyUnicode_COPY, PyUnicode_FILL, PyUnicode_MATCH +- PyUnicode_Encode, PyUnicode_EncodeUTF7, PyUnicode_EncodeUTF8, + PyUnicode_EncodeUTF16, PyUnicode_EncodeUTF32, + PyUnicode_EncodeUnicodeEscape, PyUnicode_EncodeRawUnicodeEscape, + PyUnicode_EncodeLatin1, PyUnicode_EncodeASCII, + PyUnicode_EncodeCharmap, PyUnicode_TranslateCharmap, + PyUnicode_EncodeMBCS, PyUnicode_EncodeDecimal, + PyUnicode_TransformDecimalToASCII +- Py_UNICODE_{strlen, strcat, strcpy, strcmp, strchr, strrchr} +- PyUnicode_AsUnicodeCopy + _PyUnicode_AsDefaultEncodedString is removed. It previously returned a borrowed reference to an UTF-8-encoded bytes object. Since the unicode object cannot anymore cache such a reference, implementing it without @@ -371,7 +386,7 @@ - the Py_UNICODE type, - PyUnicode_AS_UNICODE and PyUnicode_AsUnicode, -- PyUnicode_GET_LENGTH and PyUnicode_GetSize, and +- PyUnicode_GET_SIZE and PyUnicode_GetSize, and - PyUnicode_FromUnicode. When iterating over an existing string, or looking at specific -- Repository URL: http://hg.python.org/peps
participants (1)
-
martin.v.loewis