On Wed, Sep 13, 2017 at 11:56 AM, Jim J. Jewett <jimjjew...@gmail.com> wrote:
> It should be possible to opt out for an entire module, and it should > be possible to do so *without* first importing typing. > PEP 484 has a notation for this -- put # type: ignore 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.) 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.) -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/