In the spirit of 3.9 allowing builtin collections like `list`, `dict`,
`tuple`, and `set` to be subscripted for type-hinting to remove the need
for importing their equivalents from `typing`, I'd like to propose the same
thing for a few other builtin objects, namely:

`type` (for use instead of`typing.Type`)
`any` (for use  instead of `typing.Any`)
`callable` (for use instead of `typing.Callable`)

(I'm aware that a better syntax for type-hinting callables using
arrow-syntax is potentially currently in the works, so maybe this last one
can be ignored)

Having to explicitly import objects from `typing` for basic type-hinting
use-cases is a not-inconsiderable source of frustration preventing their
uptake, especially by beginners. 3.9 made a valuable step forward in
reducing this friction, but I think we can go further.
_______________________________________________
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/MX5IWZVQYZSHUO35MW2Q2VHWMLDNRHO2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to