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

Ethan Furman ethan at stoneleaf.us
Mon Feb 24 19:40:46 CET 2014

Okay, types corrected, most comments taken into account.

%b is right out, %a is still suffering scrutiny.

The arguments seem to boil down to:

We don't need it.


Somebody might, and it's better than having them inappropriately add a __bytes__ method if we don't have it.

"We don't need it" doesn't really need any further explanation.

Does anybody have any examples where %a could be useful?  Considering the work-arounds are either wrong or painful, it 
wouldn't take much to sway me towards keeping it, but at the moment it seems to be a YAGNI, plus we could always add it 
later if it turns out to be useful.  (For that matter, we could implement the main portion of the PEP now, and maybe a 
%a use-case will show up before 3.5 is released and we could add it then.)

So, any last thoughts about %a?

More information about the Python-Dev mailing list