Prev Next

Proposed PEP 349: Generalized String Coercion

Guido still prefers a bytes type (and immutable frozenbytes).

PEP 349 solves a problem I don't have often (probably because of my lack of writing such libraries), but doesn't seem to solve the problem I do have, of reading from external data sources: foo_string.decode ('ascii') is type unicode and doesn't need to be, but foo_string.decode ('iso-8859-1') might need to be or might not, depending on what it contains.