patma
patma copied to clipboard
Pattern Matching
The SC sent us their feedback, in the form of a (private) Google Doc. (I want to respect the SC members' privacy and won't link it here, but all PEP...
[This section](https://www.python.org/dev/peps/pep-0622/#static-checkers-specification) caused mostly confusion and bewilderment, and I don't consider it essential for the PEP. Static checkers have always managed to figure out how best to check existing Python...
I cooked up a match/case version of a visitor pattern from the PEG parser. This is in a function that computes and prints FIRST sets for the grammar. (It is...
Oscar Benjamin is proposing to allow `*rest` in class patterns, together with some way in `__match_args__` to indicate this is allowed. See https://mail.python.org/archives/list/[email protected]/thread/V6UC7QEG4WLQY6JBC4MEIK5UGF7X2GSD/ I personally don't think it's urgent to...
Since pattern matching is runtime behavior anyway, I wonder if we could have a way for users to construct their own patterns (without having to use `exec()`). For example: ```...
The [arguments against this](https://www.python.org/dev/peps/pep-0622/#use-a-flat-indentation-scheme) are not very strong, and it would solve the main problem with `else` (see #89). There is currently some discussion on python-dev regarding this (though no...
In short, should we be able to do simple optimizations like executing the pattern `C() | C()` as `C( | )` at runtime? Wearing my implementer hat, my answer is...
One fo the things I did related to #113 but Outside the motivation was add a new subsection at the beginning of **Syntax and Semantics**: https://github.com/dmoisset/peps/blob/motivation/pep-0622.rst#syntax-and-semantics What I'm trying to...
The PEP says that a sequence match: * cannot be any kind of string (str, bytes, bytearray) * must be an instance of `collections.abc.Sequence` I got why the first rule...
One of the places where pattern matching can shine is operating on ASTs. So it would be really useful to have good support `ast` classes from the start. And it...