PEP 318

Jess Austin jaustin at post.harvard.edu
Tue Mar 23 01:15:43 CET 2004


I'll preface by saying that I haven't fully grokked all the possible
uses of decorators.  Also, I can sympathize with the complaints about
seeing a function definition and then seeing a classmethod call on
that function 50 lines later (actually that seems like a case for
refactoring but never mind).  b-)

The brackets and the 'as' both seem awkward to me.  Also, introducing
a requirement that definition and decoration take place on the same
line seems to limit the the possibilities of decoration.  Perhaps my
class wants to offer several faces of the same method:

class foo(object):
    def __foo_method(...)
        ....
    bar = decorator1(__foo_method)
    baz = decorator2(__foo_method, arg1, arg2)

I can't imagine the exact use for this, but I can imagine that there
could be a use.  If the syntax remains as it is, that is.  This PEP
seems to shoot itself in the foot in this respect.

later,
Jess



More information about the Python-list mailing list