patma
patma copied to clipboard
Pattern Matching
The acceptance notice for PEP 634 says: > We consider that the presence of such high-quality documentation must be present on the first release of Python 3.10, and therefore its...
As much as I disagree with @markshannon about the general usefulness of pattern matching I agree with him (and previously didn't think about) cases like ``` match key: ... case...
- [ ] Grammar changes - [ ] Parser - [ ] ASDL changes - [ ] Other AST changes - [ ] Builtin type changes in C - [...
Nick released a new version of PEP 642 and suggested that it would benefit people looking at the AST or the bytecode compiler if AST nodes for patterns didn't piggy-back...
See his [python-dev message](https://mail.python.org/archives/list/[email protected]/message/4SBR3J5IQUYE752KR7C6432HNBSYKC5X/). Mainly he's still very worried about wildcards and would strongly prefer us to use `?`. He's also worried about mapping patterns defaulting to ignore extra keys....
I may have missed it, but it's not clear to me at which point are locals bound to the matched value in case of a partial match failure. For example:...
I wanted to brainstorm a bit about ideas for a custom matching protocol that would go in a follow-up PEP (note the new issue label). Some thoughts as to what...
Since we only allow guards at the top level, one is sometimes required to write things like ``` case [x, y, z] if x >= 0: ``` Here presumably the...
There were some concerns over the typical footgun of writing ``` case FOO: case BAR: ``` (with the intention that `FOO` and `BAR` are global constants, not capture patterns). The...
Several SC members seem to be in favor of adding an `else:` clause. I didn't see anyone express a preference for the indentation (align with `match` or `case`?) but if...