[Python-ideas] Add encoding attribute to bytes

Terry Reedy tjreedy at udel.edu
Tue Nov 10 03:15:40 CET 2009


Jim Jewett wrote:
> On Thu, Nov 5, 2009 at 8:15 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> A Python interpreter has one encoding for floats, ints, and strings.
>> sys.float_info and sys.int_info give details about the first two.
> 
> (Instead of changing bytes,)
> 
> This suggests a sys.string_info that contains information about the
> default string representation --including whether the internal
> encoding is UCS2 or UCS4 or something else.
> 
> That should at least make it possible to give better diagnostic messages.

What to do about interpreter-wide unicode string info, if anything, is 
related but separate from what to do about instance-specific bytes info.






More information about the Python-ideas mailing list