Decorators: J2 and a relation to @
Robert Brewer
fumanchu at amor.org
Tue Aug 24 19:11:17 EDT 2004
Shane Holloway wrote:
> From the example in Section II, part 3 of
> http://www.aminus.org/rbre/python/pydec.html consider the following
> decorated function.
>
> @using([
> funcattrs(author="Guido van Rossum"),
> memorize,
> synchronize,
> classmethod,
> ])
> def foo(cls, *args):
> pass
>
>
> This looks an lot like the suite method proposed in J2 in the current
> syntax of Python 2.4a2. All that would need to be added is a "using"
> decorator method. I like the @ because it makes me take note
> that the
> following is special in terms of code execution.[*]
>
> What do you think?
I think you've come to the same conclusion I did in the Conclusion of
the J2 proposal: everyone agrees that decorators need to be distinct.
It's up to Guido to decide "how distinct"...@ is more distinct and
"using" less so. That's the big difference.
Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org
More information about the Python-list
mailing list