Robots Atlas>ROBOTS ATLAS

Python — From Basics to Advanced · Advanced Functions

Decorators

Advanced Functions

Introduction

A decorator is a function that wraps another function to add extra behaviour — without changing its code. The @decorator syntax above def is just syntactic sugar. Used everywhere: logging, caching, authorisation, timers.