|
|
|
|
|
by nchammas
1901 days ago
|
|
This idea was briefly addressed in PEP 635 [0]: > _Statement vs. Expression._ Some suggestions centered around the idea of making `match` an expression rather than a statement. However, this would fit poorly with Python's statement-oriented nature and lead to unusually long and complex expressions and the need to invent new syntactic constructs or break well established syntactic rules. An obvious consequence of match as an expression would be that case clauses could no longer have arbitrary blocks of code attached, but only a single expression. Overall, the strong limitations could in no way offset the slight simplification in some special use cases. [0]: https://www.python.org/dev/peps/pep-0635/ |
|