[Python-ideas] Re: Introduce a boundary parameter for typing.get_type_hints when used with a class object

2020-08-05 Thread Guido van Rossum
On Wed, Aug 5, 2020 at 12:25 AM Dominik Vilsmeier 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

[Python-ideas] Re: Introduce a boundary parameter for typing.get_type_hints when used with a class object

2020-08-05 Thread Dominik Vilsmeier
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

[Python-ideas] Re: Introduce a boundary parameter for typing.get_type_hints when used with a class object

2020-08-04 Thread Guido van Rossum
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. On Tue, Aug 4, 2020 at 12:57 David Mertz wrote: > This definitely feels to me like though if an oddball case that "write > your

[Python-ideas] Re: Introduce a boundary parameter for typing.get_type_hints when used with a class object

2020-08-04 Thread David Mertz
This definitely feels to me like though if an oddball case that "write your own function" seems like the best solution. I accept the OP needs it, but I have trouble imagining that many others would. On Tue, Aug 4, 2020, 7:42 AM Dominik Vilsmeier wrote: > In one of my projects I'm reusing