From: Benjamin Peterson Date: Tue, 26 Aug 2008 17:08:40 +0000 (+0000) Subject: sort of backport 66038 by aliasing PyObject_Bytes to PyObject_Str X-Git-Tag: v2.6rc1~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14cb6bcf2ba953735ec1ef622f8ff8e23db1f326;p=thirdparty%2FPython%2Fcpython.git sort of backport 66038 by aliasing PyObject_Bytes to PyObject_Str --- diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index a2487ff56eb3..76e8beb3e114 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -130,6 +130,14 @@ Object Protocol by the :keyword:`print` statement. +.. cfunction:: PyObject* PyObject_Bytes(PyObject *o) + + .. index:: builtin: bytes + + Compute a bytes representation of object *o*. In 2.x, this is just a alias + for :cfunc:`PyObject_Str`. + + .. cfunction:: PyObject* PyObject_Unicode(PyObject *o) .. index:: builtin: unicode diff --git a/Include/object.h b/Include/object.h index 4fb8a90a3d91..b02689cc4a6e 100644 --- a/Include/object.h +++ b/Include/object.h @@ -458,6 +458,7 @@ PyAPI_FUNC(void) _PyObject_Dump(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) _PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); +#define PyObject_Bytes PyObject_Str #ifdef Py_USING_UNICODE PyAPI_FUNC(PyObject *) PyObject_Unicode(PyObject *); #endif diff --git a/Misc/NEWS b/Misc/NEWS index ff754dfbb0b3..f1aec999d876 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -29,6 +29,11 @@ Core and Builtins - Added warnings on the use of ``__getslice__``, ``__setslice__``, or ``__delslice__``. +C-API +----- + +- Aliased PyObject_Bytes to PyObject_Str. + Library -------