Skip to main content

Golang-esque defer functionality

Project description

Defer

PyPi-version PyPi-versions PyPi-license Travis CI CodeCov Codacy Code style: black Code style: prettier Thanks

Add a simple golang-esque deferral system for python.

TODO

  • Add deferrals for a function
  • Tests
  • 95% testing coverage
  • Add deferrals for a class
  • Add deferrals for a module

Example

In [1]: import defer

In [2]: @defer.with_defer
   ...: def example_function():
   ...:     print("Hello")
   ...:     defer.defer(print, "!")
   ...:     print("World")
   ...:

In [3]: example_function()
Hello
World
!

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

py-defer-1.1.2.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

py_defer-1.1.2-py2.py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 2 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