Skip to main content

Fancy `defer` in python 3.12

Project description

Fancy defer in Python 3.12

Python package Coverage Status

Installation and usage

Installation

You may install deferrer by running pip install deferrer.

Usage

There are two designed ways to use defer. You may use either of them, or mix them up.

Sugarful

>>> from deferrer import defer

>>> def f():
...     defer and print(0)
...     defer and print(1)
...     print(2)
...     defer and print(3)
...     defer and print(4)

>>> f()
2
4
3
1
0

Sugarless

>>> from deferrer import defer

>>> def f():
...     defer(print)(0)
...     defer(print)(1)
...     print(2)
...     defer(print)(3)
...     defer(print)(4)

>>> f()
2
4
3
1
0

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

deferrer-0.1.6.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

deferrer-0.1.6-py3-none-any.whl (13.5 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