Skip to content

bpo-31873: Change 12 instances of 'unicode' to 'Unicode' #4125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ in the Unicode object. The :c:type:`Py_UNICODE*` representation is deprecated
and inefficient; it should be avoided in performance- or memory-sensitive
situations.

Due to the transition between the old APIs and the new APIs, unicode objects
Due to the transition between the old APIs and the new APIs, Unicode objects
can internally be in two states depending on how they were created:

* "canonical" unicode objects are all objects created by a non-deprecated
unicode API. They use the most efficient representation allowed by the
* "canonical" Unicode objects are all objects created by a non-deprecated
Unicode API. They use the most efficient representation allowed by the
implementation.

* "legacy" unicode objects have been created through one of the deprecated
* "legacy" Unicode objects have been created through one of the deprecated
APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the
:c:type:`Py_UNICODE*` representation; you will have to call
:c:func:`PyUnicode_READY` on them before calling any other API.
Expand Down Expand Up @@ -152,7 +152,7 @@ access internal read-only data of Unicode objects:

.. c:function:: void* PyUnicode_DATA(PyObject *o)

Return a void pointer to the raw unicode buffer. *o* has to be a Unicode
Return a void pointer to the raw Unicode buffer. *o* has to be a Unicode
object in the "canonical" representation (not checked).

.. versionadded:: 3.3
Expand Down Expand Up @@ -430,7 +430,7 @@ APIs:
.. c:function:: PyObject* PyUnicode_FromFormat(const char *format, ...)

Take a C :c:func:`printf`\ -style *format* string and a variable number of
arguments, calculate the size of the resulting Python unicode string and return
arguments, calculate the size of the resulting Python Unicode string and return
a string with the values formatted into it. The variable arguments must be C
types and must correspond exactly to the format characters in the *format*
ASCII-encoded string. The following format characters are allowed:
Expand Down Expand Up @@ -504,9 +504,9 @@ APIs:
| :attr:`%A` | PyObject\* | The result of calling |
| | | :func:`ascii`. |
+-------------------+---------------------+--------------------------------+
| :attr:`%U` | PyObject\* | A unicode object. |
| :attr:`%U` | PyObject\* | A Unicode object. |
+-------------------+---------------------+--------------------------------+
| :attr:`%V` | PyObject\*, | A unicode object (which may be |
| :attr:`%V` | PyObject\*, | A Unicode object (which may be |
| | const char\* | *NULL*) and a null-terminated |
| | | C character array as a second |
| | | parameter (which will be used, |
Expand Down Expand Up @@ -1651,7 +1651,7 @@ They all return *NULL* or ``-1`` if an exception occurs.

.. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, const char *string)

Compare a unicode object, *uni*, with *string* and return ``-1``, ``0``, ``1`` for less
Compare a Unicode object, *uni*, with *string* and return ``-1``, ``0``, ``1`` for less
than, equal, and greater than, respectively. It is best to pass only
ASCII-encoded strings, but the function interprets the input string as
ISO-8859-1 if it contains non-ASCII characters.
Expand All @@ -1661,7 +1661,7 @@ They all return *NULL* or ``-1`` if an exception occurs.

.. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)

Rich compare two unicode strings and return one of the following:
Rich compare two Unicode strings and return one of the following:

* ``NULL`` in case an exception was raised
* :const:`Py_True` or :const:`Py_False` for successful comparisons
Expand Down Expand Up @@ -1689,7 +1689,7 @@ They all return *NULL* or ``-1`` if an exception occurs.
.. c:function:: void PyUnicode_InternInPlace(PyObject **string)

Intern the argument *\*string* in place. The argument must be the address of a
pointer variable pointing to a Python unicode string object. If there is an
pointer variable pointing to a Python Unicode string object. If there is an
existing interned string that is the same as *\*string*, it sets *\*string* to
it (decrementing the reference count of the old string object and incrementing
the reference count of the interned string object), otherwise it leaves
Expand All @@ -1702,6 +1702,6 @@ They all return *NULL* or ``-1`` if an exception occurs.
.. c:function:: PyObject* PyUnicode_InternFromString(const char *v)

A combination of :c:func:`PyUnicode_FromString` and
:c:func:`PyUnicode_InternInPlace`, returning either a new unicode string
:c:func:`PyUnicode_InternInPlace`, returning either a new Unicode string
object that has been interned, or a new ("owned") reference to an earlier
interned string object with the same value.