[issue46571] Strange `@typing.no_type_check` behavior for class variables
Guido van Rossum
report at bugs.python.org
Sat Jan 29 11:53:37 EST 2022
Guido van Rossum <guido at python.org> added the comment:
@no_type_check (introduced by PEP 484) is intended for static checkers, to signal to them that they shouldn't check the given function or class.
I don't think PEP 484 specifies its runtime effect -- arguably get_type_hints() could just ignore it. Or raise an exception when called on such a class. We could even argue that @no_type_check shouldn't have a runtime effect.
But before we change anything we should be guided by:
1. What is documented?
2. What does it do now?
3. How is that used by runtime type inspectors?
4. What would be most useful to runtime type inspectors?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46571>
_______________________________________
More information about the Python-bugs-list
mailing list