[Python-Dev] [Python-checkins] cpython: Implement PEP 393.

Eric V. Smith eric at trueblade.com
Sat Oct 1 22:07:47 CEST 2011


On 10/1/2011 9:26 AM, "Martin v. Löwis" wrote:
> Am 29.09.2011 01:21, schrieb Eric V. Smith:
>> Is there some reason str.format had such major surgery done to it?
> 
> Yes: I couldn't figure out how to do it any other way. The formatting
> code had a few basic assumptions which now break (unless you keep using
> the legacy API). Primarily, the assumption is that there is a notion of
> a "STRINGLIB_CHAR" which is the element of a string representation. With
> PEP 393, no such type exists anymore - it depends on the individual
> object what the element type for the representation is.

Martin: Thanks so much for your thoughtful answer. You've obviously
given this more thought than I have. From your answer, it does indeed
sound like string_format.h needs to be removed from stringlib. I'll have
to think more about formatter.h.

On the other hand, not having this code in stringlib would certainly be
liberating! Maybe I'll take this opportunity to clean it up and simplify
it now that it's free of the stringlib constraints.

Eric.


More information about the Python-Dev mailing list