-
-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
For Coconut 2.0, there will be non-backwards-compatible changes in pattern-matching syntax. Specifically:
- Python-style pattern-matching constructs will become the default (see Integrate Python 3.10 pattern matching #558).
- Thus,
vector(x, y)will need to be written asdata vector (x, y)and {"a": a, "b": b}will need to be written as{"a": a, "b": b, **{}}.
- Thus,
=<expr>will be removed and should instead be written==<expr>.x is intwill be removed and should instead be writtenint() as xorx `isinstance` int.- With
isno longer meaningisinstance,is <expr>will now be allowed in patterns to mean identity comparison.
A --coconut-syntax-version flag should be added to allow the old syntax to help in porting old codebases to 2.0.