+1 I like it, anything to get rid of Optional[type] is good. If we can replace Callable[[type1], type2] with (type1) -> type2 and typing.Any with just soft keyword “All”, type annotations will be fun! Sent from my iPhone
On 15 Aug 2021, at 8:41 PM, Joren Hammudoglu
wrote: See https://www.python.org/dev/peps/pep-0645/ _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/UYSUJO... Code of Conduct: http://python.org/psf/codeofconduct/
Surely there already is a built in for that, not quite as short as “All” but shorter than “typing.Any”: “object”. Avoids keyword pollution, already has clear meaning. And it works with isinstance! :-)
Is there something I’m missing? I never saw the point of typing.Any.
From: Abdulla Al Kathiri
participants (4)
-
Abdulla Al Kathiri
-
James Oldfield
-
Joren Hammudoglu
-
Thomas Grainger