#pythonconcepts

Python PeakPythonPeak
2025-12-12

What is a decorator in Python?

A decorator is a function that takes another function, adds some extra behavior, and returns a new function. You use it when you want to add common logic, like logging, timing, authentication or validation, without changing the original function code.

youtube.com/watch?v=79vsKNpN4QA

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst