[Python-Dev] Re: PEP: Deferred Evaluation Of Annotations Using Descriptors

2021年1月15日 18:16:06 -0800

On 16/01/21 2:09 pm, Guido van Rossum wrote:
Yeah, that wasn't very clear, and I'm not 100% sure I got it right. But consider this:
```
class Outer:
   foo = 1
   class Inner:
     print(foo)
That's true. So maybe the user should have to be explicit in
cases like this:
 class Outer:
 class Inner:
 def f(x: Outer.Inner): ...
However, I think cases like this should work:
 class C:
 t = List[int]
 def f(x: t): ...
even though the closure placed in C.__co_annotations__ wouldn't
normally have access to t without qualification.
--
Greg
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/YTZ3QRG3V6URZ3FDOZ6QON5DSYC52HGI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to