Skip to main content
Intermediatehow it works

What is a decorator, and how would a data engineer use one?

Source: Python tutorial: data structures

Quick answerFree

A decorator is a function that takes a function and returns a wrapped version, adding behaviour before or after the call without changing the original code.

Detailed answer· 59 words

Interview Prep

Unlock the full answer with Interview Prep

Get a 59-word model answer, 4 key points and a visual explainer, plus 233 more Python questions.

Also in Pro (₹499 / 90 days).

Key points· 4 points

Interview Prep
Unlock with Interview Prep

Visual explainer· animated, step by step

Interview Prep
Unlock with Interview Prep

+ 233 more Python questions in Interview Prep, each with the full answer.

Discussion