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

Glenn Linderman v+python at g.nevcal.com
Mon Feb 24 20:29:41 CET 2014

On 2/24/2014 10:40 AM, Ethan Furman wrote:
> Somebody might, and it's better than having them inappropriately add a 
> __bytes__ method if we don't have it. 

I'll admit my first thought on reading the initial discussions about 
adding bytes % formatting was "Oh, if I want to display custom objects 
in a byte stream, just add a __bytes__ method."

I don't believe there is any verbiage in the PEP (that might get 
transferred to the documentation) that explains why that would be a bad 
idea. Should there be? Whether or not %a is implemented sooner or later?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140224/68289e2e/attachment.html>

More information about the Python-Dev mailing list