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

Reply via email to