[Python-Dev] decorator support (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Mon Sep 6 22:00:59 CEST 2004
- Previous message: [Python-Dev] decorator support
- Next message: [Python-Dev] decorator support
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If there is a general agreement about what to do to wrap a decorator, why no use the following syntax
@decorator def trace(f):
I've thought of that, and it is tempting. However, it does not give you any clue what the decorator actually does, that's why I don't like it. People would declare any decorator using @decorator, without thinking whether they actually need to make that declaration. By design, any function (or, any callable for that matter) can serve as a decorator, so having a declaration for it might actually add confusion.
Regards, Martin
- Previous message: [Python-Dev] decorator support
- Next message: [Python-Dev] decorator support
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]