[Tutor] *args consumption
annaraven at gmail.com
Sun Mar 12 18:29:58 CET 2006
On 3/12/06, Kent Johnson <kent37 at tds.net> wrote:
> Danny has given some reasons why this is not useful standard behaviour.
> If this is a behaviour you need for many functions, you could create a
> decorator that provides it so you don't have to include the same
> boilerplate in each function.
> Decorators are functions that accept a function as an argument and
> return a new function as a result. Here is a decorator that will unpack
> a tuple argument:
Thanks for a great example of what decorators are good for.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor