[Python-ideas] Re: PEP Idea: Better return type annotation syntax

2022-01-06 Thread Jelle Zijlstra
On Thu, Jan 6, 2022 at 10:44 PM Tushar Sadhwani < tushar.sadhwani...@gmail.com> wrote: > With the recent submission of [PEP 677][1], I was reminded of an idea I > had with function annotation syntax since the very beginning: > > why not let me write: > > ```python > def f() -> tuple[int, str]: >

[Python-ideas] PEP Idea: Better return type annotation syntax

2022-01-06 Thread Tushar Sadhwani
With the recent submission of [PEP 677][1], I was reminded of an idea I had with function annotation syntax since the very beginning: why not let me write: ```python def f() -> tuple[int, str]: return 42, 'foo' ``` as: ```python def f() -> (int, str): return 42, 'foo' ``` Is there