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

Skip to content

Commit 08d5ca6

Browse files
committed
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
2 parents a82fe52 + 9504b13 commit 08d5ca6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Modules/arraymodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ array_fromunicode(arrayobject *self, PyObject *args)
15221522
if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
15231523
return NULL;
15241524
typecode = self->ob_descr->typecode;
1525-
if ((typecode != 'u')) {
1525+
if (typecode != 'u') {
15261526
PyErr_SetString(PyExc_ValueError,
15271527
"fromunicode() may only be called on "
15281528
"unicode type arrays");
@@ -1554,7 +1554,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
15541554
{
15551555
char typecode;
15561556
typecode = self->ob_descr->typecode;
1557-
if ((typecode != 'u')) {
1557+
if (typecode != 'u') {
15581558
PyErr_SetString(PyExc_ValueError,
15591559
"tounicode() may only be called on unicode type arrays");
15601560
return NULL;
@@ -2177,10 +2177,11 @@ array_repr(arrayobject *a)
21772177
if (len == 0) {
21782178
return PyUnicode_FromFormat("array('%c')", (int)typecode);
21792179
}
2180-
if (typecode == 'u')
2180+
if (typecode == 'u') {
21812181
v = array_tounicode(a, NULL);
2182-
else
2182+
} else {
21832183
v = array_tolist(a, NULL);
2184+
}
21842185

21852186
s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
21862187
Py_DECREF(v);

0 commit comments

Comments
 (0)