Skip to main content

Simple callbacks using decorators

Project description

Callbacks lets you use decorator syntax to set callbacks on methods or functions.

```python
from callbacks import supports_callbacks

def callback():
print "Polly!"

@supports_callbacks
def target():
print "hello",

target.add_callback(callback)

print "This should print 'hello Polly!':"
target() # prints "hello Polly!"
```

[![Build Status](https://secure.travis-ci.org/davidlmorton/callbacks.png?branch=master)](https://travis-ci.org/davidlmorton/callbacks)

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

callbacks-0.1.3.tar.gz (3.6 kB view hashes)

Uploaded Source

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