[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 (original) (raw)

Stephen J. Turnbull stephen at xemacs.org
Mon Jan 13 01:02:04 CET 2014


Ethan Furman writes:

This kind of subtlety is precisely why MAL warned about use of latin1 to smuggle bytes.

And why I've been fighting Steven D'Aprano on it.

No, I think you haven't been fighting Steven d'A on "it". You're talking about parsing and generating structured binary files, he's talking about techniques for parsing and generating streams with no real structure above the byte or encoded character level.

Of course you can implement the former with the latter using Python 3 "str", but it's ugly, maybe even painful if you need to encode binary blobs back to binary to process them. (More discussion in my other post, although I suspect you're not going to be terribly happy with that, either. ;-)

This generally is not the case for the wire protocol guys. AFAICT they really do want to process things as streams of ASCII-compatible text, with the non-ASCII stuff treated as runs of uninterpreted bytes that are just passed through.

So when you talk about "we", I suspect you are not the "we" everybody else is arguing with. In particular, AIUI your use case is not included in the use cases most of us -- including Steven -- are thinking about.



More information about the Python-Dev mailing list