summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/object.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/object.rst')
-rw-r--r--Doc/c-api/object.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index b0700a1..a7be156 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -142,10 +142,11 @@ Object Protocol
.. index:: builtin: bytes
- Compute a bytes representation of object *o*. *NULL* is returned on failure
- and a bytes object on success. This is equivalent to the Python expression
- ``bytes(o)``.
-
+ Compute a bytes representation of object *o*. *NULL* is returned on
+ failure and a bytes object on success. This is equivalent to the Python
+ expression ``bytes(o)``, when *o* is not an integer. Unlike ``bytes(o)``,
+ a TypeError is raised when *o* is an integer instead of a zero-initialized
+ bytes object.
.. cfunction:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)