Decorators and how they relate to Python - A little insight please!

Fredrik Lundh fredrik at pythonware.com
Fri Oct 20 01:46:33 EDT 2006


jmcantrell at gmail.com wrote:

> it's handy for doing things like validation of parameter and return
> types. Like...
> 
> @accepts(int,int)
> @returns(int)
> def add(a,b):
>     return a+b

using Python decorators to turn Python into something that's not Python 
doesn't seem very handy to me, though.

</F>




More information about the Python-list mailing list