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

Georg Brandl g.brandl at gmx.net
Sat Jan 11 14:49:58 CET 2014


Am 11.01.2014 10:44, schrieb Stephen Hansen:

> I mean, its not like the "bytes" type lacks knowledge of the subset of bytes
> that happen to be 7-bit ascii-compatible and can't perform text-ish operations
> on them--
> 
>   Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit
> (Intel)] on win32
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> b"stephen hansen".title()
>   b'Stephen Hansen'
> 
> How is this not a practical recognition that yes, while bytes are byte streams
> and not text, a huge subset of bytes are text-y, and as long as we maintain the
> barrier between higher characters and implicit conversion therein, we're fine?
> 
> I don't see the difference here. There is a very real, practical need to
> interpolate bytes. This very real, practical need includes the very real
> recognition that converting 12345 to b'12345' is not something weird, unusual,
> and subject to the thorny issues of Encodings. It is not violating the doctrine
> of separation of powers between Text and Bytes.

This. Exactly. Thanks for putting it so nicely, Stephen.

Georg



More information about the Python-Dev mailing list