What is Python Decorator?



What is Python Decorator?..

Answer / Arvind Kumar Pandey

A decorator in Python is a design pattern that allows you to modify the behavior of a function, method or class by wrapping it. In simple terms, a decorator is a callable object which takes another callable object and returns a new callable object. The syntax for a decorator is: @decorator_function def function_to_decorate(...).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you use raw_input in python?

1 Answers  


Why everything in python is an object?

1 Answers  


How do you sort a list alphabetically in python with sort function?

1 Answers  


Is python completely free?

1 Answers  


What are the tools that help to find bugs or perform analysis?

1 Answers  


How do I quit python?

1 Answers  


How lists is differentiated from tuples?

1 Answers  


What is kwargs in python?

1 Answers  


What is the namespace in python?

1 Answers  


How do I share global variables across modules?

1 Answers  


How to sort a dictionary by key in python?

1 Answers  


How long will it take to learn python?

1 Answers  


Categories