]> granicus.if.org Git - python/commitdiff
sort of backport 66038 by aliasing PyObject_Bytes to PyObject_Str
authorBenjamin Peterson <benjamin@python.org>
Tue, 26 Aug 2008 17:08:40 +0000 (17:08 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 26 Aug 2008 17:08:40 +0000 (17:08 +0000)
Doc/c-api/object.rst
Include/object.h
Misc/NEWS

index a2487ff56eb3385fd70ddcbd86af9817af41ed6a..76e8beb3e1148e001d1668229e4bdacb7d47c6f2 100644 (file)
@@ -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
index 4fb8a90a3d913b2ead41e68dbe0c6f40701fa6dd..b02689cc4a6ed3f4e2def65d9f17eb7a2bb75e7a 100644 (file)
@@ -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
index ff754dfbb0b30c126173822092048fda8de94ef8..f1aec999d876b394b09a0cf0c9f4f4780de312f3 100644 (file)
--- 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
 -------