I've seen people use @s in Python but I never knew what they where for, I cant seem to figure out what it is used for. What is it used for?
Asked
Active
Viewed 90 times
1 Answers
2
The @ symbol is used for class, function and method decorators.You can use a decorator to add some modified things that wouldn't be returned by function normally. Here is a nice example.
Ali Gajani
- 14,340
- 9
- 53
- 86
-
Can you put an example? – MaoKnight Jun 07 '15 at 02:59
-
1This is a good [example](http://py-men.blogspot.com/2013/09/python-class-attributes-with-validation.html). – Ali Gajani Jun 07 '15 at 03:05