Skip to content

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
@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