Message297441
Don't wait me. I have no preferences and just remind about the Martin's suggestion.
The C code looks cumbersome. It could be made a little simpler if accumulate arguments into a string rather than a list.
if (GET_TD_SECONDS(self) != 0) {
Py_SETREF(args, PyUnicode_FromFormat("%U%sseconds=%d",
args, sep, GET_TD_SECONDS(self)));
if (args == NULL)
return NULL;
sep = ", ";
}
args is initialized by an empty Python string, sep is initialized by "". PyUnicode_Join() at the end is not needed. This would save more than 20 lines.
The code could be simplified even more if use the char buffer(s) and PyOS_snprintf instead of PyUnicode_FromFormat(). |
|
Date |
User |
Action |
Args |
2017-06-30 18:46:23 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, belopolsky, vstinner, r.david.murray, martin.panter, musically_ut |
2017-06-30 18:46:23 | serhiy.storchaka | set | messageid: <1498848383.78.0.551914100202.issue30302@psf.upfronthosting.co.za> |
2017-06-30 18:46:23 | serhiy.storchaka | link | issue30302 messages |
2017-06-30 18:46:23 | serhiy.storchaka | create | |
|