I am generally supportive of leaving the type annotations unprocessed by default, but there are use cases where they should be processed (and even cases where doing it at the right time matters, because of a side effect).
I am concerned that the backwards compatibility story for non-typing cases be not just possible, but reasonable. (1) The PEP suggests opting out with @typing.no_type_hints ... The closest I could find was @typing.no_type_check, which has to be called on each object. It should be possible to opt out for an entire module, and it should be possible to do so *without* first importing typing. Telling type checkers to ignore scopes (including modules) with a # typing.no_type_hints comment would be sufficient for me. If that isn't possible, please at least create a nontyping or minityping module so that the marker can be imported without the full overhead of the typing module. (2) Getting the annotations processed (preferably at the currently correct time) should also be possible on a module-wide basis, and should also not require importing the entire typing apparatus. It would be a bit messy (like the old coding cookie), but recognizing a module-wide # typing.no_type_hints comment and then falling back to the current behavior would be enough for me. Alternatively, it would be acceptable to run something like typing.get_type_hints, if that could be done in a single pass at the end of the module (callable from both within the module and from outside) ... but again, such a cleanup function should be in a smaller module that doesn't require loading all of typing. -jJ _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/