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

`**_` in a mapping pattern and `_ :=` in a named pattern don't seem like they could ever make sense. I think we should be consistent, and *always* ignore stores...

rejected
fully pepped

It is useful to be able to match against both the type *and* the value of a target. Currently, the only way to do this is to manually assign `self`...

accepted
fully pepped

We may be able to make more powerful optimizations possible in the future if we clearly and explicitly state that there are no guarantees as to the order (or number...

accepted
fully pepped

We've been using `case`, like this: ``` match target: case Point(x, y): ... case Rectangle(x0, y0, x1, y1): ... ``` @ilevkivskyi proposes `as`, like this: ``` match target: as Point(x,...

accepted
fully pepped

Despite the immense power of pattern matching to express ideas, there is one kind of use cases that is hardly captured so far: parametrized patterns. The idea is that in...

postponed
fully pepped

Probably not very important, but while reading code it looks like a negative match may be useful. For example, when people write something like `not isisnstance(x, Foo) or x.y !=...

rejected
fully pepped

Rust is going to [disallow float literals](https://github.com/rust-lang/rust/issues/41620) in patterns. We should probably never accept them.

rejected
fully pepped

Just found these in F#: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern This is a simple extension of the `|` (OR) pattern -- e.g. we could write ``` case [x, y] & [0|1, 0|1]: print("Two bits:",...

rejected
fully pepped

@brandtbucher proposed to support `continue` in case blocks, with the semantics of skipping forward to the next case. This could be used instead of guards (#3). E.g. ``` match [randint(1,...

rejected
fully pepped

Arguably indenting case statements under the head match should not be done: 1. Other "decision statements" - if/elif/else and try/except - line up vertically. Code like the following from asyncio...