No project description provided
Project description
attempt
This package provides some utilities for working with functions that might raise exceptions.
Example
from attempt import Attempt
def f(x):
# returns TypeError if x is a str
return x + 1
xs = [1, 2, 3, "int", None, {}, 4]
ys = map(Attempt(f), xs)
assert list(values(ys, ignore_failures=True)) == [2, 3, 4, 5]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
attempt-0.1.1.tar.gz
(3.5 kB
view hashes)