[Python-ideas] decorator syntax limitation

Oleg Broytman phd at phdru.name
Thu Feb 20 22:57:13 CET 2014


On Thu, Feb 20, 2014 at 01:37:51PM -0800, Haoyi Li <haoyi.sg at gmail.com> wrote:
> I've found that a lot of the decorator syntax limitations can be worked
> around with an identity decorator:
> 
> i = lambda x: x
> @i(M(b).decorator())
> def wrapped_func():
>     pass

   Wow, what a trick!

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-ideas mailing list