Batuhan Taskaya <isidenti...@gmail.com> added the comment:

> It's been a while, I've lost context for this idea. What problem are you 
> trying to solve here? Are there issues where people have reported problems 
> that this would allow them to solve?

Context: https://github.com/python/cpython/pull/20434#discussion_r499289645

tl;dr: 
import inspect

def foo():
    class F: ...
    def foo(bar: F): ...
    print(inspect.signature(foo))

foo()

Normally, if inspect.signature is able to resolve annotations with the current 
globals()/locals() it will give the resolved version, if not the string 
version. So adding this would allow people to choose which namespace 
inspect.signature will pass to the typing.get_type_hints. 
(inspect.signature(foo, localns=locals()) would give directly the F object 
instead of 'F', etc.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41960>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to