[Python-3000] [Python-Dev] New proposition for Python3 bytes filename issue

Terry Reedy tjreedy at udel.edu
Wed Oct 1 06:39:31 CEST 2008


Martin v. Löwis wrote:
> Guido van Rossum wrote:
>> However
>> the *proposed* behavior (returns bytes if the arg was bytes, and
>> returns str when the arg was str) is IMO sane, and no different than
>> the polymorphism found in len() or many builtin operations.
> 
> My concern still is that it brings the bytes type into the status of
> another character string type, which is really bad, and will require
> further modifications to Python for the lifetime of 3.x.

I am one of those who wanted bytes kept and bytearray added and once 
grumbled about strings becoming unicode.  Now that I am using 3.0 (and 
can imagine future use of non-ascii chars), I appreciate having just one 
string type and a separation between normal text and small-int arrays. 
So I find my self, somewhat surprisingly to me, sharing Martin's concern 
about regression toward having two text types again.

There once was a discussion about whether paths should be represented by 
strings or a separate path class (that would keep a tuple of strings for 
each component).  This was rejected, as I remember, both because of the 
complication/benefit ratio and the anticipation that having just one 
string type would make string representation easier.

Using just 3.0 strings seems not to be possible.  So a different 
argument for a path class would be to encapsulate the implementation, 
which could depend on the OS, and hide the complications from the user, 
who just wants open to work.

Terry Jan Reedy



More information about the Python-3000 mailing list