<div dir="ltr">I have updated the porting HOWTO to drop recommending unicode_literals and also to mention running optional type checkers like mypy and pytype twice (once under Python 2 and again under Python 3).<br><br><div class="gmail_quote"><div dir="ltr">On Fri, 16 Dec 2016 at 11:25 Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">I am beginning to think that `from __future__ import unicode_literals` does more harm than good. I don't recall exactly why we introduced it, but with the restoration of u"" literals in Python 3.3 we have a much better story for writing straddling code that is unicode-correct.<br class="gmail_msg"><br class="gmail_msg"></div>The problem is that the future import does both too much and not enough -- it does too much because it changes literals to unicode even in contexts where there is no benefit (e.g. the argument to getattr() -- I still hear of code that breaks due to this occasionally) and at the same time it doesn't do anything for strings that you read from files, receive from the network, or even from other files that don't use the future import.<br class="gmail_msg"><br class="gmail_msg"></div>I wonder if we can add an official note to the 2.7 docs recommending against it? (And maybe even to the 3.x docs if it's mentioned there at all.)<br clear="all" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg">-- <br class="gmail_msg"><div class="m_4304038689208896787gmail_signature gmail_msg">--Guido van Rossum (<a href="http://python.org/%7Eguido" class="gmail_msg" target="_blank">python.org/~guido</a>)</div>
</div></div></div></div>
_______________________________________________<br class="gmail_msg">
Python-Dev mailing list<br class="gmail_msg">
<a href="mailto:Python-Dev@python.org" class="gmail_msg" target="_blank">Python-Dev@python.org</a><br class="gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br class="gmail_msg">
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br class="gmail_msg">
</blockquote></div></div>