3 ms·
Another thought: This would create ambiguities in the language that would harm its readability. Maybe not as far as the computer is concerned, but certainly as
by mumblemumble 6y ago
Another thought: This would create ambiguities in the language that would harm its readability. Maybe not as far as the computer is concerned, but certainly as far as the humans are concerned. Is
print(1, 2, 3)
supposed to print
1 2 3
or
(1, 2, 3)
?
What about
print (1, 2, 3)
?
Are they the same? Should they be different? I know what the answer is in Python 3.8. A few weeks or months of programming in a Python where parens are optional, though, and I wouldn't be so sure anymore.
- yuchi 6y agoThis is explicitely explained in the linked article. To solve the conflict the first parameter cannot start with a paren.
- mumblemumble 6y agoBy, "Maybe not as far as the computer is concerned, but certainly as far as the humans are concerned.", I meant to invoke the principle that there's more to a good grammar than the computer being able to parse it reliably. It's also got to not be confusing for its wet, squishy readers.