+ 2

what does the @... do in Python?

I'm very far in the python tutorial but I still don't get it what the @-thing is for? could someone explain to me?

3rd Apr 2017, 4:52 PM
Johann Leis
Johann Leis - avatar
1 Answer
+ 6
@ is a decorator. It is used to temporarily alter the behavior of a function/method - whether it's defined or called. The best learning example is a function wrapper - by using @ before the method is called, it acts as an argument for the wrapper function. See here: https://code.sololearn.com/clE70E7HXi3e/?ref=app
3rd Apr 2017, 5:17 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar