On 10/22/21 1:45 AM, Steven D'Aprano wrote:
Any other runtime annotation tool has to support strings, otherwise the
"from __future__ import annotations" directive will have already broken
it. If the tool does type-checking, then it should support stringified
annotations. They have been a standard part of type-hinting since 2014
and Python 3.5:
https://www.python.org/dev/peps/pep-0484/#forward-references
Any type-checking tool which does not already support stringified
references right now is broken.
It's an debatable point since "from future" behavior is always off by
default. I'd certainly agree that libraries /should/ support stringized
annotations by now, considering they were nearly on by default in 3.10.
But I wouldn't say stringized annotations were a "standard" part of
Python, yet. As yet they are optional. Optional things aren't
standard, and standard things aren't optional.
//arry/
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/I4AC6DQL6FB3RG6DIRUVUDBJ2MP3BKLD/
Code of Conduct: http://python.org/psf/codeofconduct/