

For the Python 3 branch: ~$ grep -C 1 cpython/Grammar/Grammarĭecorator: dotted_name ')' ] NEWLINE If you want to have a rather complete view of what a particular piece of python syntax does, look directly at the grammar file. I also do not know what to search for as searching Python docs or Google does not return relevant results when the symbol is included. Where dot is, for example, the numpy matrix multiplication function and a and b are matrices. In the context of matrix multiplication, a b invokes a._matmul_(b) - making this syntax: a b Is equivalent to this: def decorated_function():ĭecorated_function = decorator(decorated_function) In the context of decorators, this syntax: decorated_function(): In short, it is used in decorator syntax and for matrix multiplication. Realizing this finally allowed me to feel at peace with Flask. # They go as arguments here in 'flask/app.py'ĭef add_url_rule(self, rule, endpoint=None, view_func=None, **options): The microframework Flask introduces decorators from the very beginning in the following format: from flask import Flask This shows that the function/ method/ class you're defining after a decorator is just basically passed on as an argument to the function/ method immediately after the sign.

# the function gets passed onto 'topping'. # When using before a function definition
