Fix trailing comma and exponent associativity #5

Merged
R167 merged 4 commits from master into master 2021-02-17 09:01:31 +01:00
R167 commented 2021-02-17 00:52:25 +01:00 (Migrated from github.com)

Quick fix to two bugs:

  • commaSep was allowing any number of trailing commas to appear (this is an error in python)
  • ** is right associative
# Too many trailing commas (previously accepted)
x = [1, 2,,]

# Shows the right-left associativity of **
# Output: 512, Since 2**(3**2) = 2**9
print(2 ** 3 ** 2)
Quick fix to two bugs: - `commaSep` was allowing any number of trailing commas to appear (this is an error in python) - `**` is right associative ```python # Too many trailing commas (previously accepted) x = [1, 2,,] # Shows the right-left associativity of ** # Output: 512, Since 2**(3**2) = 2**9 print(2 ** 3 ** 2) ```
marijnh commented 2021-02-17 09:01:53 +01:00 (Migrated from github.com)

Thank you for spotting those.

Thank you for spotting those.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/python!5
No description provided.