decorator

Better living through Python with decorators
Download

decorator Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Michele Simionato
  • Publisher web site:
  • http://www.phyast.pitt.edu/~micheles

decorator Tags


decorator Description

Better living through Python with decorators As of now, writing custom decorators correctly requires some experience and it is not as easy as it could be. For instance, typical implementations of decorators involve nested functions, and we all know that flat is better than nested. Moreover, typical implementations of decorators do not preserve the signature of decorated functions, thus confusing both documentation tools and developers.decorator's aim is to simplify the usage of decorators for the average programmer, and to popularize decorators usage giving examples of useful decorators, such as memoize, tracing, redirecting_stdout, locked, etc.Installation: Unzip the archive in a directory called "decorator" in your Python path. For instance, on Unices you could give something like that: $ unzip decorator.zip -d decorator Testing: Just go in the package directory and give $ python doctester.py documentation.txt This will generate the main.py file containing all the examples discussed in the documentation, and will run the corresponding tests. Requirements: · Python What's New in This Release: · Small optimization in the code for decorator factories. First version with the code uploaded to PyPI (01/12/2008).


decorator Related Software