A Welcome Syntax
A Welcome Syntax
Posted Apr 22, 2025 18:56 UTC (Tue) by NYKevin (subscriber, #129325)In reply to: A Welcome Syntax by farnz
Parent article: Template strings accepted for Python 3.14
await foo is an expression, like not foo. If your colleagues are unable to understand that expressions in Python are eagerly evaluated, leftmost innermost first, I do not see how parentheses around foo would change that.
print() is very different. It was never an expression in 2.x - it was a statement, which is pointlessly restrictive in Python due to the use of syntactic whitespace (i.e. you couldn't put it in a lambda, or in various other places where almost any other code can go). It grew parentheses because, at the end of the day, it isn't a sufficiently "primitive" operation to make sense as a keyword or operator.
