I will be very happy if those versions of Callable and anonymous functions exist in Python right now. See how elegant that would look like.. 

def func(x: int, y: int, f: (int, int) -> int) -> int:
return f(x, y) 

print(func(3, 4, (x, y) => x + y)) #Out: 7


Imagine your mouse is on :func: ‘func’ in VSC or PyCharm and see that you need the third parameter to be of type (int, int) -> int, you can immediately write an anonymous function that mirrors the structure of the annotation but instead of ->, you have =>. Straight forward.

On 18 Feb 2021, at 12:43 PM, Paul Sokolovsky <pmiscml@gmail.com> wrote:

(x, y) -> x + y    translates to:   Callable[[x, y], x + y]

while

(x, y) => x + y    translates to:   lambda x, y: x + y

Huge difference.