[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-14 Thread Andreas H.
Andreas H. added the comment: Allright. B) sounds good to me. I dont think I have time today, so please feel to tackle the issue. If not I can look at it the next week. -- ___ Python tracker

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: Oh, I mean `1)` and `B` -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-14 Thread Nikita Sobolev
Nikita Sobolev added the comment: I think we should go with `1)` and `A`. Adding a special case for getting hints from `NewType` directly does seem inconsistent with other type-constructs. Do you want to fix this? :) Or I can work on it today if you wish! --

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-13 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood, sobolevn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46369] get_type_hints does not evaluate ForwardRefs inside NewType

2022-01-13 Thread Andreas H.
New submission from Andreas H. : Consider the following: NewT = typing.NewType("NewT", typing.List[typing.Optional['Z']] ) class Z: pass Now get_type_hints() does not resolve the ForwardRef within NewType (but it does so for TypedDict, dataclasses, NamedTuple). Neither