On Wed, Aug 5, 2020 at 12:25 AM Dominik Vilsmeier <dominik.vilsme...@gmx.de> wrote:
> On 04.08.20 22:05, Guido van Rossum wrote: > > Maybe get-type-hints can be refactored to make writing such a function > simpler. IIRC the part that takes a single annotation and evaluates it is a > private function. > > That's what I considered and indeed it relies on `typing._eval_type`. If > this was public then all building blocks would be in place. > In that case I recommend that you create a bpo issue about adding it and submit a PR to resolve the issue. I think the public API should have the same defaults for globalns and localns as get_type_hints(), and it should probably not expose the recursive_guard argument. Since this is a new feature and the 3.9 release is already closed for new features, this can be added in 3.10 -- in earlier releases you'll have to use `_eval_type`. (It does not seem important enough to add it to the typing_extensions module.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/75QG32L3QGRO44SKBAC6W557HHSZEXO5/ Code of Conduct: http://python.org/psf/codeofconduct/