pyxdeco

Python eXtraordinary Decorators
Download

pyxdeco Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Ian McCracken

pyxdeco Tags


pyxdeco Description

Python eXtraordinary Decorators Decorators in Python are limited to action when the function they wrap is actually called. This package adds the ability to define decorators to be called at any of the three points of the function's existence: when the function is defined, when an instance of the class containing the function is created, and when the function is itself called.pyxdeco enables the use of decorators to, e.g., tag deprecated methods and pull up a report; register instance methods as listeners to events; manipulate methods at class creation without metaclasses; and so on.pyxdeco includes decorator base classes:>>> from pyxdeco import ClassLevelDecorator>>> from pyxdeco import InstanceLevelDecorator>>> from pyxdeco import MethodLevelDecoratorand factory decorators for easy creation of decorators from functions:>>> from pyxdeco import class_level_decorator>>> from pyxdeco import instance_level_decorator>>> from pyxdeco import method_level_decoratorCreate a decorator by subclassing any of the base classes and overriding the decorate method. Alternatively, decorate a function with the factory decorator and the function will be used as the decorate method for the decorator. Requirements: · Python


pyxdeco Related Software