[Python-ideas] Left arrow and right arrow operators

Dan Sommers 2QdxY4RzWzUUiLuE at potatochowder.com
Wed Mar 13 14:54:17 EDT 2019


On 3/13/19 1:44 PM, David Teresi wrote:
> `->` would not be ambiguous in the proposed cases, but it does already
> mean something elsewhere in the language as of 3.5:
> 
> def concat(a: str, b: str) -> str:
>      return a + b
> 
> This could potentially cause confusion (as with the % operator being
> used for modulo as well as string formatting).

But by that logic, the colon is also ambiguous:  the colon
is used to indicate a dictionary entry, as in {a : str}.

Given the radically difference contexts in which the tokens
in question occur, I don't think that this is an issue (then
again, I've never designed a language as widely consumed as
Python).



More information about the Python-ideas mailing list