in Python by
Q:
What are Decorators in Python?

1 Answer

0 votes
by

Decorators are evolved from the concept of closures.

A decorator function is a higher order function that takes a function as an argument and returns the inner function.

A decorator is capable of adding extra functionality to an existing function, without altering it.

The decorator function is prefixed with @ symbol and written above the function definition.

Example

@outer

def greet():

   pass

Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked Jun 12, 2020 in Python by Robindeniel
0 votes
asked Jan 1 in Python by SakshiSharma
0 votes
asked Aug 30, 2020 in Python by sharadyadav1986
0 votes
asked Jun 30, 2020 in Python by GeorgeBell
0 votes
asked Jun 12, 2020 in Python by Robindeniel
...