@func call syntax

casevh at comcast.net casevh at comcast.net
Sun Jun 11 20:01:41 EDT 2006


teekaysoh at gmail.com wrote:
> Hi,
>
> I am new to Python, here I'd like to have a question: I noticed a
> special way to call a function in a program:
>
>     @function_name
>
> No argv is passed, even though the function_name asks for one. Any idea
> what this @something syntax is trying to achieve. I haven't been able
> to find any answer of on the google web and groups.
>
> TIA.

@function_name is called a decorator.

http://www.python.org/dev/peps/pep-0318/

http://docs.python.org/whatsnew/node6.html

casevh




More information about the Python-list mailing list