distutils and decorators

Benji York benji at benjiyork.com
Wed Sep 21 11:11:46 EDT 2005


Robert Brewer wrote:
> We're trying to get CherryPy 2.1 RC 1 out the door, but setup.py is
> giving us some problems. 

I don't know anything about distutils, so I can't help you there, but I 
never-the-less can't resist speaking up...

> In our test suite, we want to test a decorator
> that we provide. Of course, decorators won't work in Python 2.3

More accurately, the special "@" decorator syntax doesn't work in 2.3. 
I would propose that you *do not* want to test the syntax (that's what 
the Python test suite is for), but instead test the functionality of the 
decorator.  Therefore I'd switch to 2.3 compatible syntax instead. 
Something like:

def foo():
     pass

foo = cherrypy.expose("1")(foo)
--
Benji York





More information about the Python-list mailing list