<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 13, 2017 at 11:56 AM, Jim J. Jewett <span dir="ltr"><<a href="mailto:jimjjewett@gmail.com" target="_blank">jimjjewett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It should be possible to opt out for an entire module, and it should<br>
be possible to do so *without* first importing typing.<br></blockquote><div><br></div><div>PEP 484 has a notation for this -- put</div><div><br></div><div>  # type: ignore</div><div><br></div><div>at the top of your file and the file won't be type-checked. (Before you test this, mypy doesn't yet support this. But it could.)<br></div><div><br></div><div>IIUC functions and classes will still have an __annotations__ attribute (except when it would be empty) so even with the __future__ import (or in Python 4.0) you could still make non-standard use of annotations pretty easily -- you'd just get a string rather than an object. (And a simple eval() will turn the string into an object -- the PEP has a lot of extra caution because currently the evaluation happens in the scope where the annotation is encountered, but if you don't care about that everything's easy.)<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>