patma
patma copied to clipboard
Pattern Matching
Pablo pointed out that adding this is usually backwards incompatible. Maybe we need to rethink the special casing of object(c)? https://mail.python.org/archives/list/[email protected]/message/STJSSAETMTUY7FK5AE53IM73Z2WORNYN/
Once the reference implementation is at a point where the match statement is actually usable, I have been trying to think of an example program that I could write to...
Some languages have range cases, so you could write e.g. `case 1...6: print("Dice")`. This seems tricky, and quite specialized. Let's not do this?
We already allow a single unary `-` for negation of numbers. Should we also allow binary `+` if the LHS is real and the RHS is imaginary, so patterns like...
I'm only creating an issue on this because (a) it was mentioned a couple of times on python-dev and (b) we should track the discussion here (I couldn't find an...
Since we have a lot of folks adding suggestions, I realized that it might be useful to codify our design tenets - that is, the principles that have guided and...
I've added code to Brandt's reference implementation to support dataclasses as specified in the PEP. This causes the `@dataclass` decorator to generate a `__match_args__` property for the target class. However,...
Although the PEP currently defers it, I think this idea is just mature *enough* to start work on designing and testing a CPython implementation. In addition to a head start...
This is a bit pathological, but should we allow loading the name `_` in patterns? I think we should say "no", since it really has no place outside of obfuscated...
Sequence patterns aren't quite the same as sequence unpacking assignments (the behavior for iterators and strings is different), but nevertheless we may follow their lead and allow both `(x, y)`...