what is meaning of "@" in pyhon program.

Damon Getsman dgetsman at amirehab.net
Fri Jun 27 11:36:45 EDT 2008


Okay, maybe I just didn't understand the websites that were given as
examples as to 'decoration'.  I first came across the unusual '@' when
I was browsing through some extreme beginner's information on os.x
method descriptions.  I asked some other people about it and they had
no idea what it meant.  I don't _THINK_ that the decoration definition
fits, though, because the examples that I saw it in had it prefixing
an if conditional & a for loop.

ie:
@if os.exists(foo):
   etc
   etc

and

@for blah:
   etc
   etc

does this mean that the person writing the script defined a function
instead of the standard conditional and loop?  I can't imagine that
would be the case because, as I said, this was very beginning level
documentation.

-Damon Getsman



More information about the Python-list mailing list