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 levkivskyi
Recipients Lincoln Quirk, eric.smith, gvanrossum, levkivskyi, lukasz.langa, steven.daprano
Date 2019-01-27.10:31:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
It looks like an opposite side of https://github.com/python/typing/issues/508 (I wanted to work on it, but never had time to, sorry).

This question appeared couple times before, and I think there are pros and cons for both returning a ForwardRef() and for raising a NameError. So as I proposed in the issue above, there should be a flag to `get_type_hints()` that controls what to do (the name of the flag, and the default are of course debatable).

Of course, we should try to make `get_type_hints()` behave as much similar as possible with and without PEP 563, regardless. But my point is that currently we have this "in-between" behavior, and it is harder to maintain this "in-between" behavior against PEP 563, than two clearly defined extremes.

> So I expect that when calling get_type_hints it should return the unquoted string, rather than a ForwardReference.

I think the values in the returned dictionary should always be types, either fully evaluated, or ForwardRefs (expecting two options is easier than expecting three).
History
Date User Action Args
2019-01-27 10:31:36levkivskyisetrecipients: + levkivskyi, gvanrossum, eric.smith, steven.daprano, lukasz.langa, Lincoln Quirk
2019-01-27 10:31:35levkivskyisetmessageid: <[email protected]>
2019-01-27 10:31:35levkivskyilinkissue35834 messages
2019-01-27 10:31:35levkivskyicreate