Sahaj.blogs

Day page

24 Oct 2023

Study

Python · Decorators

Functions as objects, closures, writing decorators with functools.wraps, and decorators that take arguments.

  • @decorator above def f is just f = decorator(f).
  • functools.wraps copies the original function's name and docstring onto the wrapper.

Read the post →