cpython: 95da47ddebe0 (original) (raw)

--- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -21,7 +21,7 @@ defined: +-----------+--------------------+-------------------+-----------------------+-------+ | 'B' | unsigned char | int | 1 | | +-----------+--------------------+-------------------+-----------------------+-------+ -| 'u' | Py_UCS4 | Unicode character | 4 | | +| 'u' | Py_UNICODE | Unicode character | 2 | (1) | +-----------+--------------------+-------------------+-----------------------+-------+ | 'h' | signed short | int | 2 | | +-----------+--------------------+-------------------+-----------------------+-------+ @@ -35,9 +35,9 @@ defined: +-----------+--------------------+-------------------+-----------------------+-------+ | 'L' | unsigned long | int | 4 | | +-----------+--------------------+-------------------+-----------------------+-------+ -| 'q' | signed long long | int | 8 | (1) | +| 'q' | signed long long | int | 8 | (2) | +-----------+--------------------+-------------------+-----------------------+-------+ -| 'Q' | unsigned long long | int | 8 | (1) | +| 'Q' | unsigned long long | int | 8 | (2) | +-----------+--------------------+-------------------+-----------------------+-------+ | 'f' | float | float | 4 | | +-----------+--------------------+-------------------+-----------------------+-------+ @@ -47,6 +47,11 @@ defined: Notes: (1)

+(2) The 'q' and 'Q' type codes are available only if the platform C compiler used to build Python supports C :c:type:long long, or, on Windows, :c:type:__int64.

--- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -174,25 +174,24 @@ BB_setitem(arrayobject *ap, Py_ssize_t i static PyObject * u_getitem(arrayobject *ap, Py_ssize_t i) {

} static int u_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v) {

} PyDoc_STRVAR(tounicode_doc, @@ -1671,7 +1662,13 @@ typecode_to_mformat_code(char typecode) return UNSIGNED_INT8; case 'u':

case 'f': if (sizeof(float) == 4) { @@ -2419,8 +2416,14 @@ array_buffer_getbuf(arrayobject *self, P view->strides = &(view->itemsize); view->format = NULL; view->internal = NULL;

+#ifdef Py_UNICODE_WIDE

+#endif

finish: self->ob_exports++; @@ -2534,25 +2537,29 @@ array_new(PyTypeObject *type, PyObject * Py_DECREF(v); } else if (initial != NULL && PyUnicode_Check(initial)) {

+

+

@@ -2593,7 +2600,7 @@ is a single character. The following ty Type code C Type Minimum size in bytes \n[](#l2.181) 'b' signed integer 1 \n[](#l2.182) 'B' unsigned integer 1 \n[](#l2.183)