After reading a GitHub discussion on the matter 
(https://github.com/gvanrossum/patma/issues/93), '|' now makes sense to me 
instead of 'or':

- The use of the '|' character in Python seems to be going towards a union-like 
operator (dict merging, PEP 604), which is definitely appropriate here.

- The clarity of '|' and 'or' can go either way subjectivity, but a use-case I 
hadn't considered in my previous comment was nested pattern matching, e.g. 
    case (1 | 2 | 3, x) | (4 | 5 | 6, x):
    case (1 or 2 or 3, x) or (4 or 5 or 6, x):
To me, '|' seems at least as clear as 'or' in this case, since it can be read 
faster and doesn't chew up space. Spaces before and after '|' definitely help.

- As Tim noted, 'or' would exist as a solitary logical function in the current 
setup. Although, a different GitHub discussion could possibly ressurect 'and' 
(https://github.com/gvanrossum/patma/issues/97).
_______________________________________________
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/4OQET2DXBQUV3ZJNKFUS7O4JB5V7GZ5U/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to