Hello,
The idea here is to use the same operator already used to type-hint the
return of functions `->` to define the return of a Callable.
* Current syntax:
Callable[[ArgumentList], ReturnType]
eg.
def x(method: Callable[[int, dict], None]) -> None:
pass
* Proposed syntax:
Callable[ArgumentList] -> ReturnType
eg.
def x(method: Callable[int, dict] -> None) -> None:
pass
Do you think this is more intuitive? Is it viable?
Kind regards,
Thiago
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/UD5VCBGLIWWALRAJH7WSMUKGSTBEKI35/
Code of Conduct: http://python.org/psf/codeofconduct/