On Tue, 13 Sep 2016 at 18:30 Chris Angelico email@example.com wrote:
Did you know that you can actually abuse decorators to do this with existing syntax? Check out this collection of evil uses of decorators:
There's also this post from Guido a few years back in python-dev, which does something similar using metaclasses:
I'm not sure it does exactly the same, but it is also an interesting approach. (Although I like the decorator syntax more.) The discussion that follows in that thread may also be of interest for this discussion.