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

Skip to content

Commit f69fad4

Browse files
committed
Update references to parameter names
Function descriptions should now all match the changed parameters of their functions
1 parent 182f1c8 commit f69fad4

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Doc/c-api/unicode.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ access internal read-only data of Unicode objects:
181181
182182
.. c:function:: Py_UCS4 PyUnicode_READ_CHAR(PyObject *unicode, Py_ssize_t index)
183183
184-
Read a character from a Unicode object *o*, which must be in the "canonical"
184+
Read a character from a Unicode object *unicode*, which must be in the "canonical"
185185
representation. This is less efficient than :c:func:`PyUnicode_READ` if you
186186
do multiple consecutive reads.
187187
@@ -406,7 +406,7 @@ APIs:
406406
407407
.. c:function:: PyObject* PyUnicode_FromStringAndSize(const char *str, Py_ssize_t size)
408408
409-
Create a Unicode object from the char buffer *u*. The bytes will be
409+
Create a Unicode object from the char buffer *str*. The bytes will be
410410
interpreted as being UTF-8 encoded. The buffer is copied into the new
411411
object. If the buffer is not ``NULL``, the return value might be a shared
412412
object, i.e. modification of the data is not allowed.
@@ -419,7 +419,7 @@ APIs:
419419
.. c:function:: PyObject *PyUnicode_FromString(const char *str)
420420
421421
Create a Unicode object from a UTF-8 encoded null-terminated char buffer
422-
*u*.
422+
*str*.
423423
424424
425425
.. c:function:: PyObject* PyUnicode_FromFormat(const char *format, ...)
@@ -625,7 +625,7 @@ APIs:
625625
.. c:function:: PyObject* PyUnicode_Substring(PyObject *unicode, Py_ssize_t start, \
626626
Py_ssize_t end)
627627
628-
Return a substring of *str*, from character index *start* (included) to
628+
Return a substring of *unicode*, from character index *start* (included) to
629629
character index *end* (excluded). Negative indices are not supported.
630630
631631
.. versionadded:: 3.3
@@ -637,7 +637,7 @@ APIs:
637637
Copy the string *u* into a UCS4 buffer, including a null character, if
638638
*copy_null* is set. Returns ``NULL`` and sets an exception on error (in
639639
particular, a :exc:`SystemError` if *buflen* is smaller than the length of
640-
*u*). *buffer* is returned on success.
640+
*unicode*). *buffer* is returned on success.
641641
642642
.. versionadded:: 3.3
643643
@@ -924,15 +924,15 @@ wchar_t Support
924924
925925
.. c:function:: PyObject* PyUnicode_FromWideChar(const wchar_t *str, Py_ssize_t size)
926926
927-
Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given *size*.
927+
Create a Unicode object from the :c:type:`wchar_t` buffer *str* of the given *size*.
928928
Passing ``-1`` as the *size* indicates that the function must itself compute the length,
929929
using wcslen.
930930
Return ``NULL`` on failure.
931931
932932
933933
.. c:function:: Py_ssize_t PyUnicode_AsWideChar(PyObject *unicode, wchar_t *str, Py_ssize_t size)
934934
935-
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At most
935+
Copy the Unicode object contents into the :c:type:`wchar_t` buffer *unicode*. At most
936936
*size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing
937937
null termination character). Return the number of :c:type:`wchar_t` characters
938938
copied or ``-1`` in case of an error. Note that the resulting :c:type:`wchar_t*`
@@ -1002,7 +1002,7 @@ These are the generic codec APIs:
10021002
.. c:function:: PyObject* PyUnicode_Decode(const char *str, Py_ssize_t size, \
10031003
const char *encoding, const char *errors)
10041004
1005-
Create a Unicode object by decoding *size* bytes of the encoded string *s*.
1005+
Create a Unicode object by decoding *size* bytes of the encoded string *str*.
10061006
*encoding* and *errors* have the same meaning as the parameters of the same name
10071007
in the :func:`str` built-in function. The codec to be used is looked up
10081008
using the Python codec registry. Return ``NULL`` if an exception was raised by
@@ -1022,7 +1022,7 @@ These are the generic codec APIs:
10221022
.. c:function:: PyObject* PyUnicode_Encode(const Py_UNICODE *str, Py_ssize_t size, \
10231023
const char *encoding, const char *errors)
10241024
1025-
Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a Python
1025+
Encode the :c:type:`Py_UNICODE` buffer *str* of the given *size* and return a Python
10261026
bytes object. *encoding* and *errors* have the same meaning as the
10271027
parameters of the same name in the Unicode :meth:`~str.encode` method. The codec
10281028
to be used is looked up using the Python codec registry. Return ``NULL`` if an
@@ -1158,7 +1158,7 @@ These are the UTF-32 codec APIs:
11581158
const char *errors, int byteorder)
11591159
11601160
Return a Python bytes object holding the UTF-32 encoded value of the Unicode
1161-
data in *s*. Output is written according to the following byte order::
1161+
data in *str*. Output is written according to the following byte order::
11621162
11631163
byteorder == -1: little endian
11641164
byteorder == 0: native byte order (writes a BOM mark)
@@ -1232,7 +1232,7 @@ These are the UTF-16 codec APIs:
12321232
const char *errors, int byteorder)
12331233
12341234
Return a Python bytes object holding the UTF-16 encoded value of the Unicode
1235-
data in *s*. Output is written according to the following byte order::
1235+
data in *str*. Output is written according to the following byte order::
12361236
12371237
byteorder == -1: little endian
12381238
byteorder == 0: native byte order (writes a BOM mark)
@@ -1609,15 +1609,15 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
16091609
.. c:function:: Py_ssize_t PyUnicode_Tailmatch(PyObject *unicode, PyObject *substr, \
16101610
Py_ssize_t start, Py_ssize_t end, int direction)
16111611
1612-
Return ``1`` if *substr* matches ``str[start:end]`` at the given tail end
1612+
Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail end
16131613
(*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` a suffix match),
16141614
``0`` otherwise. Return ``-1`` if an error occurred.
16151615
16161616
16171617
.. c:function:: Py_ssize_t PyUnicode_Find(PyObject *unicode, PyObject *substr, \
16181618
Py_ssize_t start, Py_ssize_t end, int direction)
16191619
1620-
Return the first position of *substr* in ``str[start:end]`` using the given
1620+
Return the first position of *substr* in ``unicode[start:end]`` using the given
16211621
*direction* (*direction* == ``1`` means to do a forward search, *direction* == ``-1`` a
16221622
backward search). The return value is the index of the first match; a value of
16231623
``-1`` indicates that no match was found, and ``-2`` indicates that an error
@@ -1627,7 +1627,7 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
16271627
.. c:function:: Py_ssize_t PyUnicode_FindChar(PyObject *unicode, Py_UCS4 ch, \
16281628
Py_ssize_t start, Py_ssize_t end, int direction)
16291629
1630-
Return the first position of the character *ch* in ``str[start:end]`` using
1630+
Return the first position of the character *ch* in ``unicode[start:end]`` using
16311631
the given *direction* (*direction* == ``1`` means to do a forward search,
16321632
*direction* == ``-1`` a backward search). The return value is the index of the
16331633
first match; a value of ``-1`` indicates that no match was found, and ``-2``
@@ -1636,20 +1636,20 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
16361636
.. versionadded:: 3.3
16371637
16381638
.. versionchanged:: 3.7
1639-
*start* and *end* are now adjusted to behave like ``str[start:end]``.
1639+
*start* and *end* are now adjusted to behave like ``unicode[start:end]``.
16401640
16411641
16421642
.. c:function:: Py_ssize_t PyUnicode_Count(PyObject *unicode, PyObject *substr, \
16431643
Py_ssize_t start, Py_ssize_t end)
16441644
16451645
Return the number of non-overlapping occurrences of *substr* in
1646-
``str[start:end]``. Return ``-1`` if an error occurred.
1646+
``unicode[start:end]``. Return ``-1`` if an error occurred.
16471647
16481648
16491649
.. c:function:: PyObject* PyUnicode_Replace(PyObject *unicode, PyObject *substr, \
16501650
PyObject *replstr, Py_ssize_t maxcount)
16511651
1652-
Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* and
1652+
Replace at most *maxcount* occurrences of *substr* in *unicode* with *replstr* and
16531653
return the resulting Unicode object. *maxcount* == ``-1`` means replace all
16541654
occurrences.
16551655
@@ -1707,7 +1707,7 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
17071707
existing interned string that is the same as *\*string*, it sets *\*string* to
17081708
it (decrementing the reference count of the old string object and incrementing
17091709
the reference count of the interned string object), otherwise it leaves
1710-
*\*string* alone and interns it (incrementing its reference count).
1710+
*\*p_unicode* alone and interns it (incrementing its reference count).
17111711
(Clarification: even though there is a lot of talk about reference counts, think
17121712
of this function as reference-count-neutral; you own the object after the call
17131713
if and only if you owned it before the call.)

0 commit comments

Comments
 (0)