Issue #6687: Moved the special-case for integers out of PyBytes_FromObject.

This commit is contained in:
Alexandre Vassalotti 2009-12-31 03:56:09 +00:00
parent b05e73d9c8
commit eb6f8de8bf
3 changed files with 33 additions and 25 deletions

View file

@ -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)