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)
target() # prints "hello Polly!"
```
[](https://travis-ci.org/davidlmorton/callbacks)
[](https://coveralls.io/r/davidlmorton/callbacks)
```python
from callbacks import supports_callbacks
def callback():
print "Polly!"
@supports_callbacks
def target():
print "hello",
target.add_callback(callback)
target() # prints "hello Polly!"
```
[](https://travis-ci.org/davidlmorton/callbacks)
[](https://coveralls.io/r/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.2.0.tar.gz
(8.9 kB
view details)
File details
Details for the file callbacks-0.2.0.tar.gz.
File metadata
- Download URL: callbacks-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c92cce3544fdff062d0424bb25d559b65619deca3c1ce7eff4ef8514b7267ad
|
|
| MD5 |
21ab80d5ba815e3a87a00d50dd2bdae3
|
|
| BLAKE2b-256 |
bac388b08e630cb0e92a7bd3dde5fc74cacb7754f6e43a202f26d3248abb1b1f
|