Hello,

On Mon, 18 May 2020 02:39:27 +0100
MRAB <pyt...@mrabarnett.plus.com> wrote:

[]

> > Or maybe we could leverage the new walrus operator and write
> > 
> >       str := (int)
> >   
> It would be closer to the existing annotation if we could write:
> 
>      [int] -> str

To make it clear, the talk is about "better", not "existing" annotation
syntax, which is a square (literally) peg in a round hole.

With PEP 0563, there's totally no need to wrap everything in square
brackets, and atrocities like __class_getitem__ can be treated like an
implementation detail of a particular Python implementation (CPython,
that is).

With PEP 0563, while evaluating annotations, one can just pass to eval()
a suitably constructed "globals" dict, to enable any operators on any
symbols (which would be represented by objects, not classes), or just
operate on AST with even finer level of control.



-- 
Best regards,
 Paul                          mailto:pmis...@gmail.com
_______________________________________________
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/DOUR5EK2WYSNE7TUNFJ6DQTPWQMASDUL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to