@@ -423,7 +423,7 @@ APIs:
423423
424424.. c :function :: PyObject *PyUnicode_FromString (const char *u)
425425
426- Create a Unicode object from an UTF-8 encoded null-terminated char buffer
426+ Create a Unicode object from a UTF-8 encoded null-terminated char buffer
427427 *u *.
428428
429429
@@ -556,14 +556,13 @@ APIs:
556556.. c :function :: PyObject* PyUnicode_FromEncodedObject (PyObject *obj, \
557557 const char *encoding, const char *errors)
558558
559- Coerce an encoded object *obj * to an Unicode object and return a reference with
560- incremented refcount.
559+ Decode an encoded object *obj * to a Unicode object.
561560
562561 :class: `bytes `, :class: `bytearray ` and other
563562 :term: `bytes-like objects <bytes-like object> `
564563 are decoded according to the given *encoding * and using the error handling
565564 defined by *errors *. Both can be *NULL * to have the interface use the default
566- values (see the next section for details).
565+ values (see :ref: ` builtincodecs ` for details).
567566
568567 All other objects, including Unicode objects, cause a :exc:`TypeError` to be
569568 set.
@@ -745,8 +744,11 @@ Extension modules can continue using them, as they will not be removed in Python
745744
746745.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj)
747746
748- Shortcut for ``PyUnicode_FromEncodedObject(obj, NULL, "strict") `` which is used
749- throughout the interpreter whenever coercion to Unicode is needed.
747+ Copy an instance of a Unicode subtype to a new true Unicode object if
748+ necessary. If *obj * is already a true Unicode object (not a subtype),
749+ return the reference with incremented refcount.
750+
751+ Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
750752
751753
752754Locale Encoding
@@ -1224,7 +1226,7 @@ These are the UTF-16 codec APIs:
12241226
12251227 If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get
12261228 represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE`
1227- values is interpreted as an UCS-2 character.
1229+ values is interpreted as a UCS-2 character.
12281230
12291231 Return *NULL* if an exception was raised by the codec.
12301232
0 commit comments