This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith
Date 2015-08-25.21:30:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440538211.37.0.431052107009.issue24939@psf.upfronthosting.co.za>
In-reply-to
Content
Objects/stringlib/unicode_format.h does not belong in stringlib. Back when it was originally written for 2.x, it used stringlib to provide the str and unicode versions of str.format, str.__format__, int.__format__, etc.

However, in 3.x, and especially with PEP 393 (Flexible String Representation), not only is the stringlib functionality no longer needed, it's not used at all.

My suggestion is to just copy the source into Objects/unicodeobject.c, which is the only place it's used. Then delete the stringlib file.

The only downside of including it in unicodeobject.c is that it makes our largest C file about 8% larger:

wc -l says:
1284  Objects/stringlib/unicode_format.h
15414 Objects/unicodeobject.c

There's some argument to be made to separate out the int.__format__, float.__format__ etc. code, and move them to some other library. I don't think they're a huge part of unicode_format.h. And to separate them out would require creating some _Py_* functions to do their work. But it's probably the right thing to do. I'll investigate.
History
Date User Action Args
2015-08-25 21:30:11eric.smithsetrecipients: + eric.smith
2015-08-25 21:30:11eric.smithsetmessageid: <1440538211.37.0.431052107009.issue24939@psf.upfronthosting.co.za>
2015-08-25 21:30:11eric.smithlinkissue24939 messages
2015-08-25 21:30:11eric.smithcreate