This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author n_rosenstein
Recipients BTaskaya, JelleZijlstra, eric.smith, gvanrossum, joperez, kj, levkivskyi, lukasz.langa, miss-islington, n_rosenstein
Date 2022-01-25.18:34:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643135654.4.0.426529343599.issue41370@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-01-25 18:34:14n_rosensteinsetrecipients: + n_rosenstein, gvanrossum, eric.smith, lukasz.langa, levkivskyi, JelleZijlstra, miss-islington, BTaskaya, joperez, kj
2022-01-25 18:34:14n_rosensteinsetmessageid: <1643135654.4.0.426529343599.issue41370@roundup.psfhosted.org>
2022-01-25 18:34:14n_rosensteinlinkissue41370 messages
2022-01-25 18:34:14n_rosensteincreate