Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbeb6b6

Browse files
committed
Merged revisions 63678,63688,63690,63696 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r63678 | benjamin.peterson | 2008-05-26 08:01:25 -0500 (Mon, 26 May 2008) | 2 lines put a big note on configure.in asking people to run autoconf ........ r63688 | benjamin.peterson | 2008-05-26 09:29:09 -0500 (Mon, 26 May 2008) | 2 lines fix a minor typo ........ r63690 | benjamin.peterson | 2008-05-26 09:51:54 -0500 (Mon, 26 May 2008) | 2 lines fix typo (thank Georg) ........ r63696 | benjamin.peterson | 2008-05-26 10:54:26 -0500 (Mon, 26 May 2008) | 2 lines add PyByteArray docs ........
1 parent 27ad091 commit fbeb6b6

3 files changed

Lines changed: 79 additions & 1 deletion

File tree

Doc/c-api/bytearray.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.. highlightlang:: c
2+
3+
.. _bytearrayobjects:
4+
5+
Byte Array Objects
6+
------------------
7+
8+
.. index:: object: bytearray
9+
10+
11+
.. ctype:: PyByteArrayObject
12+
13+
This subtype of :ctype:`PyObject` represents a Python string object.
14+
15+
16+
.. cvar:: PyTypeObject PyByteArray_Type
17+
18+
This instance of :ctype:`PyTypeObject` represents the Python bytearray type;
19+
it is the same object as ``bytearray`` in the Python layer.
20+
21+
22+
.. cfunction:: int PyByteArray_Check(PyObject *o)
23+
24+
Return true if the object *o* is a bytearray object or an instance of a
25+
subtype of the bytearray type.
26+
27+
28+
.. cfunction:: int PyByteArray_CheckExact(PyObject *o)
29+
30+
Return true if the object *o* is a bytearray object, but not an instance of a
31+
subtype of the bytearray type.
32+
33+
34+
.. cfunction:: PyObject* PyByteArray_FromObject(PyObject *o)
35+
36+
Return a new bytearray object from any object, *o*, that implements the
37+
buffer protocol.
38+
39+
40+
.. cfunction:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
41+
42+
Create a new bytearray object from *string* and it's length, *len*. On
43+
failure, *NULL* is returned.
44+
45+
46+
.. cfunction:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
47+
48+
Return the size of *bytearray* after checking for a *NULL* pointer.
49+
50+
51+
.. cfunction:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray)
52+
53+
Macro version of :cfunc:`PyByteArray_Size` that doesn't do pointer checking.
54+
55+
56+
.. cfunction:: char* PyByteArray_AsString(PyObject *bytearray)
57+
58+
Return the contents of *bytearray* as a char array after checking for a
59+
*NULL* pointer.
60+
61+
62+
.. cfunction:: char* PyByteArray_AS_STRING(PyObject *bytearray)
63+
64+
Macro version of :cfunc:`PyByteArray_AsString` that doesn't check pointers.
65+
66+
67+
.. cfunction:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
68+
69+
Concat bytearrays *a* and *b* and return a new bytearray with the result.
70+
71+
72+
.. cfunction:: PyObject* PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
73+
74+
Resize the internal buffer of *bytearray* to *len*.

Doc/c-api/concrete.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ intrinsic to the Python language.
6666
.. toctree::
6767

6868
bytes.rst
69+
bytearray.rst
6970
unicode.rst
7071
buffer.rst
7172
tuple.rst

configure.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
dnl Process this file with autoconf 2.0 or later to make a configure script.
1+
dnl ***********************************************
2+
dnl * Please run autoreconf to test your changes! *
3+
dnl ***********************************************
4+
dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63).
25

36
# Set VERSION so we only need to edit in one place (i.e., here)
47
m4_define(PYTHON_VERSION, 3.0)

0 commit comments

Comments
 (0)