Skip to content

Latest commit

 

History

History
18 lines (5 loc) · 1018 Bytes

File metadata and controls

18 lines (5 loc) · 1018 Bytes

Decorator-in-Python

A decorator in Python is a special function that takes another function and adds extra features to it — without changing its original code.

You can think of a decorator as a wrapper around a function. The original function still works the same way, but the decorator allows you to extend its behavior, such as logging, timing, validation, or access control.

In simple terms:

A decorator “enhances” a function by wrapping it with additional functionality.