Skip to main content

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


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)

Uploaded Source

Built Distribution

classic_aspects-0.0.1-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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