Open gvanrossum opened 4 years ago
Again, agreed in every point. There is no really strong argument either way, and hence no actual reason not to go with |
.
Perhaps a simple thought experiment: if Python had opted for ||
instead of or
(like various C-based languages), would those in favour of or
then also want to write case (1 || 2 || 3):
? Does it really add something...?
In the SC-VC we ended up deciding to keep the existing |
symbol.
Labeling as rejected (we're keeping |
) and we've added discussion to PEP 635, so doesn't need more pep.
At least two SC members don't like
|
and would prefer we spell this asor
.Arguments heard include:
or
is already frequently used cuts either way|
has many other uses cuts either way|
looks better visually is a matter of personal preferenceTo which my main response would be
|
is used in the same way in other matching contexts, e.g. regular expressions, EBNF grammars, and "parser combinators" (e.g. https://pypi.org/project/parsita/:escaped = (quote | reverse_solidus | solidus | backspace | <etc.>)
or
always separates conditions, which are not the same thing as patternsBut if I had to I could get used to
or
.