Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces around .. and ..< #31

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Spaces around .. and ..< #31

merged 1 commit into from
Jan 26, 2024

Conversation

arnetheduck
Copy link
Owner

Although NEP1 suggests not having spaces around these infix operators, this creates an exception to the normal infix spacing rules.

In spite of this recommendation, lots of code out there maintains spaces around the operators which makes decision based on "existing practice" hard.

Adding to the complexity is in order to not break the AST, the code must take care to remove the spaces only in cases where the infix is not followed by another operator - this means that we sometimes will put spaces around these infixes and sometimes not, again leading to irregularity.

Since there's no consensus in existing code, the rule is irregular and causes implementation complexity, this PR removes the exception and formats .. and ..< with spaces.

Although NEP1 suggests not having spaces around these infix operators,
this creates an exception to the normal infix spacing rules.

In spite of this recommendation, lots of code out there maintains spaces
around the operators which makes decision based on "existing practice"
hard.

Adding to the complexity is in order to not break the AST, the code must
take care to remove the spaces only in cases where the infix is not
followed by another operator - this means that we _sometimes_ will put
spaces around these infixes and sometimes not, again leading to
irregularity.

Since there's no consensus in existing code, the rule is irregular and
causes implementation complexity, this PR removes the exception and
formats `..` and `..<` with spaces.
@arnetheduck arnetheduck merged commit 6065e70 into master Jan 26, 2024
6 checks passed
@arnetheduck arnetheduck deleted the infix-spaces branch January 26, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant