Comments
I'll make a pr on this branch |
@Viicos How does this cause a problem in practice? Changing |
If you are referring to |
I'm referring to the IMO, if you want this level of introspection, you should just use |
I just used this as an example to illustrate the bug. |
It’s just an alternative approach …On Mon, Jun 9, 2025 at 07:15 Peter Bierma ***@***.***> wrote: *ZeroIntensity* left a comment (python/cpython#130870) <#130870 (comment)> Hm, ok, that makes more sense. For clarity: how is your PR (#131583 <#131583>) different from the first PR (#130897 <#130897>)? — Reply to this email directly, view it on <#130870 (comment)>, or unsubscribe <https://.com/notifications/unsubscribe-auth/BNITW57VEOVPZPL5O2Y4QXD3CTRLJAVCNFSM6AAAAABYLSHBKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJUGQZTCNBVGQ> . You are receiving this because you commented.Message ID: ***@***.***> |
Bug report
Bug description:
In
typing._eval_type
, generic aliases are reconstructed this way:As
GenericAlias
is subclassable, we can loose the actual subclass in some cases:I couldn't find a way to get actual bugs from it, but the repr is different:
The issue is also relevant for
typing._strip_annotations()
.Proposed fix
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
GenericAlias
subclasses intyping.get_type_hints()
#131583The text was updated successfully, but these errors were encountered: