patma icon indicating copy to clipboard operation
patma copied to clipboard

Pattern Matching

Results 92 patma issues
Sort by recently updated
recently updated
newest added

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/

accepted
fully pepped

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...

fully pepped

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?

rejected
fully pepped

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...

accepted
fully pepped

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...

unpeppable
meta

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...

meta

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,...

accepted
fully pepped

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...

reference implementation

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...

accepted
fully pepped

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)`...

accepted
fully pepped