On 1/13/2014 3:13 PM, Guido van Rossum wrote:
On Mon, Jan 13, 2014 at 12:02 PM, Brett Cannon <br...@python.org> wrote:
On Mon, Jan 13, 2014 at 2:51 PM, Terry Reedy <tjre...@udel.edu> wrote:
I personally would not add 'bytes % whatever'.

Personally, neither would I; just focus on bytes.format() and let % operator
on strings slowly go away.

Well, % has some very strong arguments in its favor still -- for

If I shift from a 'personal' to a 'BDFL' viewpoint, I have to agree.

example, the sheer amount of code that currently uses it, the fact
that it's as close as we get to a cross-language standard, and the

This much I know.

fact that nobody wants to tackle its use in the logging module (since
logger objects are often shared between packages that don't know about
each other).

This I did not know.

Anyway, the % or .format() issue seems completely orthogonal to the
issues that get people riled up (which are mostly about whether using
either implies some kind of ASCII compatibility).

A possibly important difference between '%s' and '{:s}' is that the 's' is required in the former and optional in the latter. So in byteformat(), b'{:s}' continues to format a string (as encoded bytes) while '{:}' 'formats' a byte without having to invent a new code that does not exist in 2.7. That particular solution to "does 's' mean bytes or string" does not work for % formatting. (And that lack, in turn, is part of what lay behind the inclination expressed above.)

For % formatting, I would be inclined to start with 'what does mecurial need?' or even 'does anything even really work for hg?'. Hg is part of our development ecosystem, and we have an hg rep who expressed a desire to experiment.

Terry

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to