A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132697.html below:

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

[Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2Chris Angelico 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
> the
>     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.

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4