[Python-ideas] RFC: bytestring as a str representation [was: a new bytestring type?]

Antoine Pitrou solipsis at pitrou.net
Wed Jan 8 12:38:22 CET 2014


On Wed, 8 Jan 2014 20:31:10 +0900
INADA Naoki <songofacandy at gmail.com>
wrote:
> 
> You're right. I've not considered using surrogateescape here.
> 
> But MySQL connection may be not utf8. It's default latin1 and you can use
> many encoding.
> Some encoding doesn't ensure roundtrip. In such encoding,
> 
[...]
> 
> But I think decode/encode with surrogateescape is not only slow, but also
> dangerous when using
> encoding except ascii or utf8.

You're right. Thanks exposing your use case, I think it's a good data
point for the bytes formatting PEP.

Regards

Antoine.




More information about the Python-ideas mailing list