[Python-ideas] Decorator syntax restriction

Carl Johnson cmjohnson.mailinglist at gmail.com
Sat Oct 10 08:12:44 CEST 2009


2009/10/8 Zac Burns:

> Use case:
>
> @noDecorator if not debug else debug
>

One might also write:

@debug if debug else lambda f: f
def f....

Is that too confusing though? My instinct says it's fine, but maybe
others disagree. Still, I think the restriction should be taken off.
We're all adults, etc.

— Carl



More information about the Python-ideas mailing list