[Python-Dev] Re: 2.4a2, and @decorators (original) (raw)

Jim Fulton jim at zope.com
Wed Aug 4 15:46:55 CEST 2004


Terry Reedy wrote:

...

Decorators will add complexity, regardless of syntax.

Especially in their current over-powered form. If decorators didn't have to take arguments, then you could use a syntax like:

def classmethod foo(cls, ...): ...

This does add complexity, but I think it enhances understandability.

I understand why some people want to be able to pass arguments to decorators, but frankly, I find many of the examples of doing so down right scary.

An advantage of the @ syntax is than it makes the complexiity separable and ignorable for someone learning/teaching basic Python,

I don't agree that they are ignorable. People will see them in code and will have to understand what they mean. Given sme examples I've seen here, this will sometimes be a significant chalenge.

Jim

-- Jim Fulton mailto:jim at zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org



More information about the Python-Dev mailing list