<div dir="ltr"><div class="gmail_default">Previously, I expressed some concerns about PEP 563 regarding what should happen when a string is used as an annotation. Since my point here is more general, I'm starting yet another thread.</div><div class="gmail_default"><br></div><div class="gmail_default">For a lot of existing type-annotated code, adding "from __tuture__ import annotations" [1] *doesn't break anything*.</div><div class="gmail_default"><br></div><div class="gmail_default">But that doesn't seem right. The whole point of __future__ imports is to break things. Maybe the __future__ import will not give a 100% equivalent functionality to what will be in Python 4 by default, but anyway, it's Python 4 that should break as little as possible. This leaves the breaking business to the future import, if necessary.</div><div class="gmail_default"><br></div><div class="gmail_default">If someone cares enough to add the future import that avoids needing string annotations for forward references, it shouldn't be such a big deal to get a warning if there's a string annotation left. But the person upgrading to Python 4 (or whatever they might be upgrading) will have a lot less motivation to figure out what went wrong.</div><div class="gmail_default"><br></div><div class="gmail_default">Then again, code that works in both Python 3 and 4 could still have the future import. But that would defeat the purpose of Python 4 as a clean and high-performance dynamic language.</div><div class="gmail_default"><br></div><div class="gmail_default">—Koos<br></div><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif">[1] As defined in the PEP 563 draft:</span><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default"><a href="https://mail.python.org/pipermail/python-dev/2017-November/150062.html">https://mail.python.org/pipermail/python-dev/2017-November/150062.html</a><br></div><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif">-- </span><br></div><div class="gmail_signature">+ Koos Zevenhoven + <a href="http://twitter.com/k7hoven" target="_blank">http://twitter.com/k7hoven</a> +</div>
</div>