<div dir="ltr"><div><div><div>AFACT, in that message Victor was only talking about allowing Unicode filenames.<br><br></div>Making everything polymorphic is clearly pulling on the thread that will unravel the entire sweater.<br>
<br></div>But... The start of this thread was about changing a few occurrences of isinstance(..., str) to use basestring, and that's a different matter. The Python 2 Unicode design calls for mixing of Unicode and 8-bit strings as long as the latter contain 7-bit ASCII -- the code in turtle violates that design by insisting on an 8-bit string. The underlying Tkinter module handles Unicode strings just fine (and not just 7-bit ASCII).<br>
<br></div>As far as lib2to3 goes, using basestring instead of str actually disambiguates things -- with str it can't tell for sure whether text or binary was meant, but with basestring it's a safe bet that the intention was text.<br>
<br>Finally, in most places Python 2.7 *does* handle Unicode filenames just fine.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 2, 2014 at 6:26 PM, Stephen J. Turnbull <span dir="ltr"><<a href="mailto:stephen@xemacs.org" target="_blank">stephen@xemacs.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Terry Reedy writes:<br>
> On 3/2/2014 4:23 PM, Serhiy Storchaka wrote:<br>
<br>
</div><div class=""> > > Patches which add support for unicode strings were accepted for one<br>
> > issues (e.g. <a href="http://bugs.python.org/issue19099" target="_blank">http://bugs.python.org/issue19099</a>) and rejected for other<br>
> > issues (e.g. <a href="http://bugs.python.org/issue20014" target="_blank">http://bugs.python.org/issue20014</a> and<br>
> > <a href="http://bugs.python.org/issue20015" target="_blank">http://bugs.python.org/issue20015</a>). Some issues (e.g.<br>
> > <a href="http://bugs.python.org/issue18695" target="_blank">http://bugs.python.org/issue18695</a>) hang in undefined state.<br>
><br>
> If Antoine and Guido don't reverse themselves, those could perhaps be<br>
> re-opened. It strikes me as borderline, depending interpretation of<br>
> 'string'. I am not surprised there have been different resolutions.<br>
<br>
</div>I agree with Victor in <a href="http://bugs.python.org/issue18695#msg208857" target="_blank">http://bugs.python.org/issue18695#msg208857</a>:<br>
there's no "bug". It is just that in the design of 2.x 'str' is not<br>
Unicode, and the "fix" is Python 3. This may be an area where 2to3<br>
could give more help.<br>
<br>
As Victor points out in that message, the issue-by-issue approach to<br>
this inconsistency is just whack-a-mole.<br>
<br>
I would worry not only about the whack-a-mole aspect where 'unicode'<br>
objects leak into contexts where they're not supported, but also that<br>
this could confuse tools like 2to3.<br>
<br>
I agree that usage of the word "string" is all too often ambiguous in<br>
the documentation, but that doesn't justify a wholesale overhaul of<br>
the Python 2.7 API to make everything polymorphic.<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/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/mailman/options/python-dev/guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div>