[Python-ideas] Default decorator?
castironpi at comcast.net
Thu Jan 17 01:37:41 CET 2008
> -----Original Message-----
> From: python-ideas-bounces at python.org [mailto:python-ideas-
> bounces at python.org] On Behalf Of Guido van Rossum
> Sent: Wednesday, January 16, 2008 6:32 PM
> Peter Norvig suggested an idea to me over lunch: a "default
> decorator". This would be something you could set once per module and
> it would be invoked for each function definition in the same way as a
> decorator is invoked, before any explicit decorators. His use case was
> something that wraps every function that uses argument annotations
> with something that interprets those annotations in a certain way and
> enforces that interpretation. It would save having to explicitly
> annotate every function or method that way.
__decor__= functools.partial( "when's that?" )
print 'no args.'
More information about the Python-ideas