b3j0f.annotation: Python annotation library

Indices and tables

Description

This library aims to provides tools to do annotation in a reflective language.

License Development Status Latest release Supported Python versions Supported Python implementations Download format Build status Code test coverage Downloads

Installation

pip install b3j0f.annotation

Features

What does mean annotations in a reflective way:

  • one annotation can annotate several objects at a time (modules, classes, functions, instances, builtins, annotation like themselves, etc.).
  • such as a reflective object, they could have their own behavior and lifecycle independently to annotated elements.

This library provides the base Annotation class in order to specialize your own annotations, and several examples of useful annotation given in different modules such as:

  • async: dedicated to asynchronous programming.
  • interception: annotations able to intercept callable object calls.
  • call: inherits from interception module and provides annotations which allow to do checking on callable objects.
  • check: annotations which check some conditions such as type of annotated targets, max number of annotated elements, etc.
  • oop: useful in object oriented programming like allowing to weave mixins.

Examples

Perspectives

  • Cython implementation.

Changelog

0.1.5 (27/02/2015)

  • Fix bug when trying to annotate a class constructor in python3+.

0.1.4 (27/02/2015)

  • Fix bug when trying to annotate a class constructor.

0.1.3 (14/02/2015)

  • Add selection function in Annotation selection functions.

0.1.2 (02/12/2015)

  • Move code from the package annotation to the module core.

Donating

I'm grateful for gifts, but don't have a specific funding goal.