Provides convenient utils for late decorating, based on idea of aspects-oriented programming
Project description
Classic Aspects
This package provides convenient utils for late decorating, based on idea of aspects-oriented programming. Part of project "Classic".
Usage:
from classic.aspects import PointCut
points = PointCut()
@points.join_point
def add_numbers(left, right):
return left + right
assert add_numbers(1, 2) == 3 # Returns 3
def some_decorator(fn):
def wrapper(*args, **kwargs):
print('Function called!')
return fn(*args, **kwargs)
return wrapper
add_numbers.join(some_decorator)
assert add_numbers(1, 2) == 3 # Returns 3 and print "Function called!"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
classic-aspects-0.0.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for classic_aspects-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2eec257f6816b3f9b58881e50c958bf40978f15721de5885a30ef5775469e36 |
|
MD5 | e7f04312be99ffdae6843eeb78c3eb57 |
|
BLAKE2b-256 | 3db16eb9ecc0aa0f95e7981c219b51d50c6f777f1f4b73b159883f2ff0bd0206 |