pampy icon indicating copy to clipboard operation
pampy copied to clipboard

Pampy: The Pattern Matching for Python you always dreamed of.

Results 23 pampy issues
Sort by recently updated
recently updated
newest added

Hello, is this project still alive? I noticed that the owner hasn't been active for a year and no PRs have been accepted for a while. I know that pattern...

I always want to write something like Haskell in Python ``` with Multimethod() as fib: fib[1] = 1 fib[2] = 2 fib[int] = lambda n: fib(n-1) + fib(n-2) ``` and...

The current behavior is that if an action is a function it by default gets called; I have some scenarios where this is undesireable. For instance, I might want to...

PEP: 622 proposes [Structural Pattern Matching](https://github.com/python/peps/blob/master/pep-0622.rst) for python 3.10. For some users it may be interesting how difficult it would be to port the pampy pattern matching code to native...

Matching an instance of a class against it's class works perfectly but i just realied that you cannot match with the class itself: ``` class Marker: pass match({"my_marker": Marker}, {"my_marker":...

In conda-recipe-s it is not possible to include pip dependencies, could you please also publish pampy as conda package?

this is taken from #43 Idea: ```py from pampy import match, _, raise_error return match(x, 1, "foo", 2, "bar", _, raise_error(ValueError, "Message") ) ```

Hi, Great jobs on pampy ! this is the closest thing I could find to `core.match` from clojure. I'm wondering if we can apply a new `guard` function in matching...

Added a file to improve the syntax (pampy_scala.py). It is just a wrapper around the match function to make it feel more like the Scala pattern matching syntax.

Is there a way to match a pattern like `[_, 0, _]` only if the two `_`s are equal, and if they aren't continue to the next pattern?