Screenshots are captured in a Docker container with a headless browser. Task: MIL-004#1 Task: MIL-004#2 Task: MIL-004#3 Task: MIL-004#4 Task: MIL-004#5
743 B
743 B
English · Dansk · Bahasa Melayu
Lecture 4: Decorators
Code: src/higher_lower/presentation/lectures/step_04_decorators.py.
What we gained
- A decorator is a function that takes a function and returns a new function.
make_bold,make_emphasisandmake_underlinedadd<b>,<em>and<u>once, so no route repeats the tags.- Decorators stack: the one nearest the function runs first.
functools.wrapskeeps the name of the function, which Flask needs for every route.
