Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add raise_error function #45

Open
rochacbruno opened this issue Feb 19, 2020 · 1 comment
Open

add raise_error function #45

rochacbruno opened this issue Feb 19, 2020 · 1 comment

Comments

@rochacbruno
Copy link

this is taken from #43

Idea:

from pampy import match, _, raise_error

return match(x,
  1, "foo",
  2, "bar",
  _, raise_error(ValueError, "Message")
)
@blakev
Copy link

blakev commented Jul 5, 2020

Alternatively, functionality like toolz.functoolz.excepts would delegate a case when an exception is raised.

See here, https://toolz.readthedocs.io/en/latest/_modules/toolz/functoolz.html#excepts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants