[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convertrules.py with decorator update for today's git
From: |
Wilbert Berendsen |
Subject: |
Re: convertrules.py with decorator update for today's git |
Date: |
Wed, 2 Jul 2008 08:36:09 +0200 |
User-agent: |
KMail/1.9.9 |
Op woensdag 2 juli 2008, schreef Han-Wen Nienhuys:
> I know what a decorator is - I'm sorry for thinking it didn't work,
> but the code is a bit obtuse, and I got confused by
>
> return lambda f: conversions.append ((version, f, message))
>
> which stores the conv function, but then will also redefine the conv
> function to None. Essentially it does
>
> def dec(f):
> return None
>
> @dec
> def f(x):
> return 1
>
> print f
>
> =>
>
> None
Yes, the function is not returned by the decorator because it needs not to be
stored in 'conv'; it would be overwritten anyway by the next rule. (In the
current situation the value of conv also changes after every function
redefinition).
> Can you document this more clearly so it does not look so strange?
Ok. Does everybody like the syntax of a rule like this?
> Also the patch should look like a proper commit, with description
> prepended and your name attached as author.
I don't know exactly how to do that, but I'll try to find out :)
cheers,
Wilbert Berendsen
--
LilyKDE, LilyPond for KDE: http://lilykde.googlecode.com/