What does the Python function keyword do?
python
Solution
That's because `function` is not a python keyword.
If you expand your view just a little, you can see that `function` is a variable (passed in as a parameter).
def autoAddScript(function):
"""
Returns a decorator function that will automatically add it's result to the element's script container.
"""
def autoAdd(self, *args, **kwargs):
result = function(self, *args, **kwargs)
if isinstance(result, ClientSide.Script):
self(result)
return result
else:
return ClientSide.Script(ClientSide.var(result))
return autoAdd
Problem
I was looking at this line of code - ``` result = function(self, *args, **kwargs) ``` And I was not able to find a definition of the `function` keyword for Python. Could someone link me to the docs and/or explain that this line of code does? I intuitively think I know, but I don't understand why I can't find any docs on it. In searching through http://docs.python.org both the `new` module and its successor types seem to have something to do with it.