On the theme of the addition of pip operators to indicate union, I was 
wondering what people think of using the following shortcuts for type hints.
* type[] be a short-hand for List[type]
* [type1, type2, type3] be a shorthand for Tuple[type1, type2, type3]
* similar ideas for dictionaries and callables with (perhaps with 
javascript-like arrow notations?)

I just think something like this would be easier to read. For example, a lot of 
functions that return tuples generally are immediately unpacked when it's used, 
so I think this is a more clear and concise way of stating that this is that it 
returns three elements: an element of type1, an element of type2 and an element 
of type3. In other words, the fact that it's a tuple does not matter much.
_______________________________________________
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/GLDHYVUQVKQ5MPBCAS4SUU36JWGJZNWF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to