Message411660
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. |
|
Date |
User |
Action |
Args |
2022-01-25 18:34:14 | n_rosenstein | set | recipients:
+ n_rosenstein, gvanrossum, eric.smith, lukasz.langa, levkivskyi, JelleZijlstra, miss-islington, BTaskaya, joperez, kj |
2022-01-25 18:34:14 | n_rosenstein | set | messageid: <1643135654.4.0.426529343599.issue41370@roundup.psfhosted.org> |
2022-01-25 18:34:14 | n_rosenstein | link | issue41370 messages |
2022-01-25 18:34:14 | n_rosenstein | create | |
|