[Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 3

Thomas Wouters thomas at python.org
Wed Mar 26 16:14:00 CET 2014


On Tue, Mar 25, 2014 at 11:37 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> In particular, ``%s`` will not accept numbers (use a numeric format code
> for
> that), nor ``str`` (encode it to ``bytes``).
>

I don't understand this restriction, and there isn't a rationale for it in
the PEP (other than "you can already use numeric formats", which doesn't
explain why it's undesirable to have it anyway.) It is extremely common in
existing 2.x code to use %s for anything, just like people use {} for
anything with str.format. Not supporting this feels like it would be
problematic for porting code. Did this come up in the earlier discussions?

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm an email virus! Think twice before sending your email to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140326/66fdcc08/attachment.html>


More information about the Python-Dev mailing list