Hello,

On Sun, 17 May 2020 14:31:34 +0200
Alex Hall <alex.moj...@gmail.com> wrote:

[]

> If we consider the arrow, what about ≤ instead of <=, ≥ instead of
> >=, ≠ instead of !=, × instead of `*`, and math.π instead of math.pi?

Before this goes too a big shaky bikeshed over almost nothing, let me
point out that if you're looking to improve something in type
annotations, I would suggest to look for true ugliness there.
Something like Callable[[Dict[str, int], Sequence[Foo]],
Dict[PrimaryKey, List[int]]]. That's rather unreadable.

Actually, let me just quote
https://docs.python.org/3/library/typing.html#typing.Callable

> Callable type; Callable[[int], str] is a function of (int) -> str.

Lolwhat? If it's a function of "(int) -> str", then it should be
written just about like that. With
https://www.python.org/dev/peps/pep-0563/ , a lot of things which
weren't previously possible, are now possible. Somebody should start
thinking how to take advantage of that, up to allowing "(int) ->
str".

Which is apparently not possible currently, as while "evaluation" is
postponed, it still should parse eagerly as Python syntax. But even
{(int): str} is a better type annotation for a function than
Callable[[int], str].

And if we e.g. talk about making "->" a special operator which would
allow it to appear in other contexts than function definition,
"(int) -> str" (and other interesting annotation syntaxes) would be
possible.


-- 
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/CTS42YQ6N3Q44WHY2Y4CRAF6NISQNZUW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to