Skip to content

A simple golang-esque deferral system for python.

License

Notifications You must be signed in to change notification settings

naphta/py-defer

Repository files navigation

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
!

About

A simple golang-esque deferral system for python.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages