Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Alternative OR symbol #146

Open
gvanrossum opened this issue Aug 26, 2020 · 3 comments
Open

Alternative OR symbol #146

gvanrossum opened this issue Aug 26, 2020 · 3 comments
Labels
fully pepped Issues that have been fully documented in the PEP rejected A rejected idea sc-feedback Issues raised in the steering committee feedback

Comments

@gvanrossum
Copy link
Owner

gvanrossum commented Aug 26, 2020

At least two SC members don't like | and would prefer we spell this as or.

Arguments heard include:

  • Don't buy the argument that many other languages use this ("Python isn't those other languages, and there are plenty of differences already")
  • Since for readability you would normally add spaces, it's only one character shorter
  • The argument about priority cuts either way
  • That or is already frequently used cuts either way
  • That | has many other uses cuts either way
  • Whether | looks better visually is a matter of personal preference

To which my main response would be

  • Let's not unnecessarily invent where we can easily copy
  • | 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.>)
  • UPDATE: to me, or always separates conditions, which are not the same thing as patterns

But if I had to I could get used to or.

@gvanrossum gvanrossum added the sc-feedback Issues raised in the steering committee feedback label Aug 26, 2020
@Tobias-Kohn
Copy link
Collaborator

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...?

@gvanrossum gvanrossum added fully pepped Issues that have been fully documented in the PEP rejected A rejected idea labels Sep 16, 2020
@gvanrossum
Copy link
Owner Author

In the SC-VC we ended up deciding to keep the existing | symbol.

@gvanrossum gvanrossum added needs more pep An issue which needs to be documented in the PEP and removed rejected A rejected idea labels Sep 16, 2020
@gvanrossum gvanrossum added rejected A rejected idea and removed needs more pep An issue which needs to be documented in the PEP labels Oct 20, 2020
@gvanrossum
Copy link
Owner Author

Labeling as rejected (we're keeping |) and we've added discussion to PEP 635, so doesn't need more pep.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fully pepped Issues that have been fully documented in the PEP rejected A rejected idea sc-feedback Issues raised in the steering committee feedback
Projects
None yet
Development

No branches or pull requests

2 participants