Paul Clifford wrote:
>
>  * All decorators change from:
>        @decorate
>        def fn(...):
>            ...
>    to
>        def fn(...):
>            ...
>        fn = decorate(fn)

FYI, PyProtocols' "protocols.advice" module has support to make
decorators that work in Python 2.3, with a few rather important
limitations.

First, the syntax is:

    [decorate()]
    def fn(...):
         ....

The decorator has to be called, and it has to be specifically written
to use the protocols.advice hooks.  It may break a debugger that's
running when the decorator is called.  Decorating in multiple scopes at
the same time may not work correctly.

However, if you can live with all of those limitations, then you can
get a decorator syntax that will work with both 2.3 and 2.4.

Reply via email to