Skip to main content

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


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)

Uploaded Source

Built Distribution

attempt-0.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page