Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140302/9de9bc39/attachment.html below:
<div dir="ltr"><div>It looks to me like a defect in the library (*), and you are making a reasonable argument that we should fix it in 2.7 to help people be more prepared for the transition to Python 3.<br><br></div>(*) As Antoine points out, pretty much the only time where it's not a good idea to switch from str to basestring is when the data is meant to be binary -- but in this case it's clearly text (we can also tell from what the same code looks like in Python 3 :-).<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 2, 2014 at 12:01 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Suppose a 2.7 standard library function is documented as taking a 'string' argument, such as these examples from the turtle module.<br>
<br>
pencolor(colorstring)<br>
Set pencolor to colorstring, which is a Tk color specification string, such as "red", "yellow", or "#33cc8c".<br>
<br>
turtle.shape(name=None)<br>
Parameters: name – a string which is a valid shapename<br>
<br>
class turtle.Shape(type_, data)<br>
Parameters: type_ – one of the strings “polygon”, “image”, “compound”<br>
<br>
Suppose adding<br>
from __future__ import unicode_literals<br>
to a working program causes an exception, such as with turtle<br>
<a href="http://bugs.python.org/issue15618" target="_blank">http://bugs.python.org/<u></u>issue15618</a><br>
(Note: unicode_literals is not indexed.)<br>
<br>
Is this a programmer error for passing unicode instead of string, or a library error for not accepting unicode?<br>
Is changing 'isinstance(x, str)' in the library (with whatever other changes are needed) a bugfix to be pushed or a prohibited API expansion?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Terry Jan Reedy<br>
<br>
<br>
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>guido%40python.org</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4