3 ms·
# No. This code: @decorate def foo(self): frobnicate() #is exactly equivalent to: def foo(self): frobnicate() foo = decorate(foo) http://www
by llimllib 18y ago
# No. This code:
@decorate
def foo(self):
frobnicate()
#is exactly equivalent to:
def foo(self):
frobnicate()
foo = decorate(foo)
http://www.python.org/dev/peps/pep-0318/ http://www.python.org/dev/peps/pep-0318/
- gaius 18y agoYeah, but that's really clunky when you want to do @this @that @the_other def foo(self): frobnicate() This is what Java people call "aspect oriented programming" and get all excited about, but to us it's no big deal :-)