[Python-Dev] PEP 461 Final? (original) (raw)

Stephen J. Turnbull stephen at xemacs.org
Sat Jan 18 05:59:57 CET 2014


Nick Coghlan writes:

I also suggest introducing the phrase "ASCII compatible segments in binary formats" somewhere,

What is the use case for "ASCII compatible segments"? Can't you just say "ASCII segments"?

I'm not sure exactly what PEP 461 says at this point, but most of the discussion prescribes .encode('ascii', errors='strict') for implicit interpolation of str. "ASCII compatible" is a term that people consistently to interpret to include the bytes representation of their data. Although the actual rule isn't terribly complex (bytes 0-127 must always have ASCII coded character semantics[1]), AFAIK there are no use cases for that other than encoded text, ie, interpolating str, and nobody wants that done leniently in Python 3.

Footnotes: [1] Otherwise you need to analyze the content of data to determine whether "ASCII-compatible" operations are safe to perform. Of course that's possible but it was repeatedly rejected in favor of duck-typing.



More information about the Python-Dev mailing list