Feb-16-2018, 10:39 PM
In some code I've seen stuff like this:
I thought a -> int was called a decorator, but a decorator seems to be this:
So if a -> int is not a decorator, what's it called and what does it do?
1 2 |
def some_function(a - > int ): #do something |
1 2 3 4 5 6 7 8 9 |
def some_function(func): def some_func( * args): #do something to func return func( * args) return some_func @some_function def some_other_function(params): #do something |