[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations Using Descriptors, round 2

2021年4月12日 19:20:37 -0700

On Tue, 2021年04月13日 at 10:47 +0900, Inada Naoki wrote:
> On Tue, Apr 13, 2021 at 9:57 AM Larry Hastings <[email protected]>
> wrote:
> > This is really the heart of the debate over PEP 649 vs PEP 563. If
> > you examine an annotation, and it references an undefined symbol,
> > should that throw an error? There is definitely a contingent of
> > people who say "no, that's inconvenient for us". I think it should
> > raise an error. Again from the Zen: "Special cases aren't special
> > enough to break the rules." Annotations are expressions, and if
> > evaluating an expression fails because of an undefined name, it
> > should raise a NameError.
> I agree that this is the heart of the debate. I think "annotations
> are
> for type hitns". They are for:
> 
> * Static type checkers
> * document.
+ dynamic type validation, encoding and decoding (Pydantic, FastAPI,
Fondat, et al.)
Paul
_______________________________________________
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/57GR7AN7L647CGMMHDWTK3PVL27HFKEZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to