Skip to content

Commit c3489f2

Browse files
skirpichevvstinner
andauthored
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
1 parent 7c6ac57 commit c3489f2

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ argparse
632632
array
633633
-----
634634

635-
* Support the :c:expr:`float complex` and :c:expr:`double complex` C types
636-
(formatting characters ``'F'`` and ``'D'`` respectively).
635+
* Support the :c:expr:`float complex` and :c:expr:`double complex` C types:
636+
formatting characters ``'F'`` and ``'D'`` respectively.
637637
(Contributed by Sergey B Kirpichev in :gh:`146151`.)
638638

639639

Lib/test/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ def test_byteswap(self):
15691569
if a.itemsize in (1, 2, 4, 8):
15701570
b = array.array(self.typecode, self.example)
15711571
b.byteswap()
1572-
if a.itemsize==1:
1572+
if a.itemsize == 1:
15731573
self.assertEqual(a, b)
15741574
else:
15751575
# On alphas treating the byte swapped bit patterns as
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Support the :c:expr:`float complex` and :c:expr:`double complex` C types in
2-
the :mod:`array` module (formatting characters ``'F'`` and ``'D'``
3-
respectively). Patch by Sergey B Kirpichev.
1+
Support the :c:expr:`float complex` and :c:expr:`double complex` C types
2+
in the :mod:`array` module: formatting characters ``'F'`` and ``'D'``
3+
respectively. Patch by Sergey B Kirpichev.

Modules/arraymodule.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,8 @@ array.array.byteswap
15581558
15591559
Byteswap all items of the array.
15601560
1561-
If the items in the array are not 1, 2, 4, 8 or 16 bytes in size, RuntimeError is
1562-
raised. Note, that for complex types the order of
1561+
If the items in the array are not 1, 2, 4, 8 or 16 bytes in size, RuntimeError
1562+
is raised. Note, that for complex types the order of
15631563
components (the real part, followed by imaginary part) is preserved.
15641564
[clinic start generated code]*/
15651565

@@ -2359,8 +2359,9 @@ array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
23592359
const char *memstr = PyBytes_AS_STRING(items);
23602360

23612361
converted_items = PyList_New(itemcount);
2362-
if (converted_items == NULL)
2362+
if (converted_items == NULL) {
23632363
return NULL;
2364+
}
23642365
for (i = 0; i < itemcount; i++) {
23652366
PyObject *pycomplex = PyComplex_FromDoubles(
23662367
PyFloat_Unpack4(&memstr[i * 8], le),
@@ -2381,8 +2382,9 @@ array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
23812382
const char *memstr = PyBytes_AS_STRING(items);
23822383

23832384
converted_items = PyList_New(itemcount);
2384-
if (converted_items == NULL)
2385+
if (converted_items == NULL) {
23852386
return NULL;
2387+
}
23862388
for (i = 0; i < itemcount; i++) {
23872389
PyObject *pycomplex = PyComplex_FromDoubles(
23882390
PyFloat_Unpack8(&memstr[i * 16], le),

0 commit comments

Comments
 (0)