Makoto Kuwata <[email protected]> wrote:
> I'm sad about this restriction because:
>
> @recipe.product('*.html').ingreds('$(1).rst')
> def file_html(c):
> # do something
>
> is enough simple and more readable than:
>
> @recipe.product('*.html')
> @recipe.ingreds('$(1).rst')
> def file_html(c):
> # do something
>
> But I'll follow the Python's philosophy.
Personally, I'd find this approach a lot clearer:
rst2html = recipe.product('*.html').ingred('$(1).rst')
@rst2html
def file_html(c):
# etc
It allows for easier reuse of your decorators and it labels it in a
way that I can understand from the name as opposed to having to
decipher the decorator method chain to work out its intent.
--
http://mail.python.org/mailman/listinfo/python-list