[Python-ideas] Strings can sometimes convert to bytes without an encoding

Random832 random832 at fastmail.com
Wed Jun 15 13:14:45 EDT 2016


On Tue, Jun 14, 2016, at 21:06, Steven D'Aprano wrote:
> On Tue, Jun 14, 2016 at 07:46:34PM -0400, Franklin? Lee wrote:
> > On Tue, Jun 14, 2016 at 7:26 PM, Guido van Rossum <guido at python.org> wrote:
> > > -1. Such a check for the contents of the string sounds exactly like the
> > > Python 2 behavior we are trying to get away with.
> > 
> > But isn't it really just converting back and forth between two
> > representations of the same thing? A str with char width 1 is
> > conceptually an ASCII string; 
> 
> How do you reason that? There are many one-character strings that aren't 
> ASCII, and encode to two or more bytes.

I think he's using "char width" to mean "width of the character type in
bytes", not "length of the string", and referring to implementation
details of the FSR. But at that point, why say it's conceptually ASCII
rather than conceptually Latin-1?


More information about the Python-ideas mailing list