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

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to