Antoine Pitrou writes: > Bytes objects are often used for partly ASCII strings, All I can say to that phrase is, "urk, ISO 2022 anyone?" > not arbitrary "arrays of bytes". And making indexing of bytes > objects return ints was IMHO a mistake. Bytes objects are not ASCII strings, even though they can be used to represent them. The practice of using magic numbers that look like English words is a useful one, but by the same token, it should not be too easy to use bytes to represent *text* just because the programmer doesn't know any words that don't fit into 7*N bits. With PEP 393, there isn't even really a space excuse. AFAICS, anything that should be done with ASCII-punned magic numbers ("protocol tokens", if you prefer) can be done with slices and (ta-da!) case conversion. (Sorry, Nick!) But the components of a bytes object are just numbers; they are not characters until you've run them through a codec.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4