Niklas Rosenstein <rosensteinnik...@gmail.com> added the comment:

You're right, let me trim it down:

In production we use `get_type_hints()` a lot, expecting it to resolve strings 
as forward references as per it's original API contract. However, PEP 585 
generics parametrized with strings in Python 3.10 doesn't work like that (as 
the documentation already points out). `get_type_hints()` itself does not fail, 
subsequently broke our code because it was not built to expect strings in 
`GenericAlias.__args__`.


What I ask myself is what motivated the decision to change the behaviour for 
PEP 585 generics in `get_type_hints()` and not go the extra mile.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to