How can python find decorated functions within it? How can python find decorated functions within it? flask flask

How can python find decorated functions within it?


Your assumption is wrong. Decorators are themselves executable code, and they are called when the function they decorate is defined, ie at import time. The code within the decorator can then add the route to its registry.