[Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2
rosuav at gmail.com
Sun Feb 23 04:07:48 CET 2014
On Sun, Feb 23, 2014 at 12:56 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Open Questions
> It has been suggested to use ``%b`` for bytes as well as ``%s``.
> - Pro: clearly says 'this is bytes'; should be used for new code.
> - Con: does not exist in Python 2.x, so we would have two ways of doing
> same thing, ``%s`` and ``%b``, with no difference between them.
The fact that the format string is bytes says 'this is bytes'. Also
the fact that you're explicitly encoding any strings used. I'm -1 on
having %b as a redundant duplicate of %s.
More information about the Python-Dev