<div dir="ltr">I've actually found unicode_literals useful in getting code to be Python 2/3-compatible. I try to use a Python 3-like model of always using unicode for text data and only using str for binary data, and unicode_literals helps achieve that, since most string literals are meant to be text, not binary data. The issue with functions like getattr is annoying, but in my experience it's not a common problem (I don't often call getattr() with a string literal as an argument).</div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-16 14:56 GMT-08:00 Raymond Hettinger <span dir="ltr"><<a href="mailto:raymond.hettinger@gmail.com" target="_blank">raymond.hettinger@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Dec 16, 2016, at 11:24 AM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
><br>
> 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>
><br>
> 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>
><br>
> 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>
<br>
</span>+1  Leaving it in place will likely cause more problems than it solves, so I think your suggest is a net win even if there is some bit of disruption.  Also, as far as I can tell, the adoption rate of Python 3.2 was very low.  Python 3's story didn't become attractive until later.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Raymond<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/jelle.zijlstra%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>jelle.zijlstra%40gmail.com</a><br>
</div></div></blockquote></div><br></div>