[Python-Dev] Re: Call for defense of @decorators (original) (raw)
Roman Suzi rnd at onego.ru
Sun Aug 8 12:09:25 CEST 2004
- Previous message: [Python-Dev] Re: Call for defense of @decorators
- Next message: [Python-Dev] Re: Call for defense of @decorators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, 7 Aug 2004, [ISO-8859-1] "Martin v. L?wis" wrote:
But must it be "@", such an eye-catching, ugly piece of flie-dirt? If you don't like the current proposal, try to find objective reasons, in addition to the subjective ones. Also, try to come up with counter-proposals that are well thought-out, instead of being created in a rush. In particular, if all you are concerned with is the specific choice of operator, propose a different one.
BTW, hat is wrong with my %-proposal:
def foo(self) % decor(): body
and
def foo(self) % (decor(), decor1(args), ...): body
- it seems to satisfy the needs.
This form could also be added (for consistency):
def foo(self): # old way body
foo %= decor()
or
foo %= (decor(), decor1(args), ...)
or
foo = foo % (decor())
- and this doesnt require to add new symbol (@),
- it is semantically consistant with % meaning as a formatting ("decorating") operation, although in case of def the part being decorated is on LHS, while in string formatting arguments are being "decorated" according to the format string.
I want to hear the critics of this as I see this a better syntax to the decoration needs!
Regards, Martin
Sincerely yours, Roman Suzi
rnd at onego.ru == My AI powered by GNU/Linux RedHat 7.3
- Previous message: [Python-Dev] Re: Call for defense of @decorators
- Next message: [Python-Dev] Re: Call for defense of @decorators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]