Terry J. Reedy added the comment:

The behavior of str.strip is not what I would expect from reading 
'''str.strip([chars])
    Return a copy of the string with the leading and trailing characters 
removed.'''
but I guess it is consistent with a general rule that when mixing bytes and 
unicode (which was not always), the bytes are latin-1 decoded to unicode. 
However, the 'not always' part (str.strip yes, str.ljust no) made Python a bit 
inconsistent with itself.

Adding the unicode_literals import made Python more inconsistent with itself. 
"You can change byte literals to unicode literals, but if you do and you use 
one of the stdlib text apis that are bytes only, your program breaks."  This 
patch moves the inconsistency around a bit but does not remove it.  People who 
stick with 2.7 will have to live with inconsistency one way or another.

The turtle color issue is quite different in that it involve text names ('red') 
or encodings('#aabbcc') for color tuples that are quoted as text in order to be 
passed on to tkinter and tk (which wants unicode anyway).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20015>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to