On 13/07/2022 14:14, o.jacob.nils...@gmail.com wrote:
Hi, I like this PEP but I couldn't find the motivation for using angle brackets 
over square braces (brackets?). The survey in Appendix A is great but lacks any 
conclusions. From that survey alone I would assume that angle brackets would 
have been chosen over square braces, given that they are the most common option 
and appear in (afaik) the more popular languages in that list. I think the PEP 
should add a section about the choice of syntax in the rejected section, which 
can be expanded upon in Appendix A.

If you can't tell I'm in favor of angle brackets, I think the examples given in 
the PEP look a bit messy with so many parentheses and square braces in close 
proximity. Using angle brackets would make the distinction between typevars and 
function parameters clearer.

Another reason that square brackets should be preferred over angle brackets is the difficulty in parsing:

list<list<int>>

is tokenised as list < list < int >> where the last token is a right shift operator, so the parser has to know that sometimes >> is used when two "angle bracket" groups are closed, instead of > >

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CNIEGWWROWN4Y4IPVH72CDKCFO3OSHLY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to