Author serhiy.storchaka
Recipients belopolsky, martin.panter, musically_ut, r.david.murray, serhiy.storchaka, vstinner
Date 2017-07-01.05:04:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498885486.7.0.19175755096.issue30302@psf.upfronthosting.co.za>
In-reply-to
Content
> Isn’t there a “Unicode writer” API that could be used?

It could be used if accumulate only Python strings, C strings and separate characters. But in any case we need to convert C integers to strings, and add up to 3 items per every attribute (separator, name, value), the result of every addition should be checked. PyUnicode_FromFormat() is an easy way to concatenate several items. It needs only one check.

> The annoying part is to handle the ", " separator. I also had bad experiences with handling char* strings. It's so easy to make mistakes :-(

It could be simpler if use the trick with the sep variable. As for mistakes, actually that version of Utkarsh's patch was less buggy than the few following versions using the Python C API. But the final C code is correct and LGTM.
History
Date User Action Args
2017-07-01 05:04:46serhiy.storchakasetrecipients: + serhiy.storchaka, belopolsky, vstinner, r.david.murray, martin.panter, musically_ut
2017-07-01 05:04:46serhiy.storchakasetmessageid: <1498885486.7.0.19175755096.issue30302@psf.upfronthosting.co.za>
2017-07-01 05:04:46serhiy.storchakalinkissue30302 messages
2017-07-01 05:04:46serhiy.storchakacreate