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/132759.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 2 [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2Stuart Bishop stuart at stuartbishop.net
Tue Feb 25 08:43:00 CET 2014
On 23 February 2014 08:56, Ethan Furman <ethan at stoneleaf.us> wrote:

> ``%a`` will call :func:``ascii()`` on the interpolated value's
> :func:``repr()``.
> This is intended as a debugging aid, rather than something that should be
> used
> in production.  Non-ascii values will be encoded to either ``\xnn`` or
> ``\unnnn``
> representation.

So we use %a for exactly the same purposes that we used to use %r.

> Unsupported codes
> -----------------
>
> ``%r`` (which calls ``__repr__`` and returns a :class:`str`) is not
> supported.

But you propose changing the code.

I think there would have been a lot less discussion if you just
defined %r to do what you propose for %a, as everything would work as
people expected.


-- 
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/
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