[Python-ideas] Proposal for new-style decorators

Daniel Stutzbach stutzbach at google.com
Tue Apr 26 19:42:23 CEST 2011


On Tue, Apr 26, 2011 at 10:10 AM, Christophe Schlick <cschlick at gmail.com>wrote:

> @decorator
> def new_style_repeat_fix(self, *args, **keys):
>  """docstring for decorating function"""
>  print "apply %r on %r" % (self.deco.__name__, self.func.__name__)
>  for n in range(3): self.func(*args, **keys)


I'm sure it's not exactly as you envisioned, but the decorator package
provides roughly what you're describing:

http://micheles.googlecode.com/hg/decorator/documentation.html#decorator-is-a-decorator

-- 
Daniel Stutzbach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110426/e6ebf618/attachment.html>


More information about the Python-ideas mailing list