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.3.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_defer-1.3.0-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file py-defer-1.3.0.tar.gz.

File metadata

  • Download URL: py-defer-1.3.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for py-defer-1.3.0.tar.gz
Algorithm Hash digest
SHA256 c3f04fdd6204623f304966c38ceb28d776c52590ba6897ceb450f19562fddcae
MD5 c3d615f92978ee61456e0415d0de9749
BLAKE2b-256 761d4f7e828d133401d69e788b332e3abf3640a9927ef2ea5a16ddca857ae1ab

See more details on using hashes here.

File details

Details for the file py_defer-1.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: py_defer-1.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for py_defer-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a16283a1317490121bb959b9f9a09a5ce7ba0e246a3103ed130a70005db06109
MD5 e015505eaa65e988b7fd2399d5cd57ab
BLAKE2b-256 9596f50c3d1241af21bfe4ec3cedc1c4db1eb22ad2b6e0b75ee40ab65c70e84e

See more details on using hashes here.

Supported by

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