3 ms·
> And then concepts like Callable, Union, TypedDict, and Optional don't have dedicated syntax for readability; they're generic types that you have to import and
by duckerude 6y ago
> And then concepts like Callable, Union, TypedDict, and Optional don't have dedicated syntax for readability; they're generic types that you have to import and parameterize.
Union is getting dedicated syntax in 3.10: https://www.python.org/dev/peps/pep-0604/ https://www.python.org/dev/peps/pep-0604/
Optional could follow: https://www.python.org/dev/peps/pep-0645/ https://www.python.org/dev/peps/pep-0645/
- brundolf 6y agoGood to know! That's exciting
- cstejerean 6y agoThat’s great news. Hopefully PEP 505 gets revised as well, which would make optional not only more ergonomic to declare but also more ergonomic to use.