A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-March/133605.html below:

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

[Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 3Ethan Furman ethan at stoneleaf.us
Thu Mar 27 18:55:15 CET 2014
On 03/27/2014 10:29 AM, Guido van Rossum wrote:
>
> I also don't understand why we can't use %b instead of %s. AFAIK %b currently doesn't mean anything and I somehow don't
> expect we're likely to add it for other reasons (unless there's a proposal I'm missing?). Just like we use %a instead of
> %r to remind people that it's not quite the same (since it applies .encode('ascii', 'backslashreplace')), shouldn't we
> use anything *but* %s to remind people that that is also not the same (not at all, in fact)? The PEP's argument against
> %b ("rejected as not adding any value either in clarity or simplicity") is hardly a good reason.

The biggest reason to use %s is to support a common code base for 2/3 endeavors.  The biggest reason to not include %b 
is that it means binary number in format(); given that each type can invent it's own mini-language, this probably isn't 
a very strong argument against it.

I have moderate feelings for keeping %s as a synonym for %b for backwards compatibility with Py2 code (when it's 
appropriate).

--
~Ethan~
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