decorator 2.0 released
michele.simionato at gmail.com
Sat Jan 13 11:45:33 CET 2007
The aim of the decorator module it to simplify the usage of decorators
for the average programmer. Version 2.0 is a major release. From
The decorator module is intented for usage in Python 2.4 and above,
but it also works with limitated functionality in Python 2.3 and
If you have ``easy_install``, just type ``easy_install decorator``,
unzip the distribution archive into a directory called "decorator"
in your Python path. For instance, on Unices you could give something
$ unzip decorator.zip -d decorator
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.
The 2.0 release of the decorator module breaks backward compatibility
a few minor ways.
- now ``decorator`` fails setting the right name for the decorated
when using Python 2.3. I judged that this was an acceptable price
considering that Python 2.3 has become pretty old and that in any
using decorators in Python 2.3 is uncommon.
- now the decorated function and the original function do not share the
same attributes, the decorated function has just a copy of the
original function attributes.
- now the utility function ``getinfo`` returns a different dictionary;
- the utility function ``newfunc`` has been removed; its functionality
subsumed into ``update_wrapper``.
More information about the Python-announce-list