Skip to content

Akash006/Decorators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DECORATORS IN PYTHON

  • A decorator is a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure.
  • It allows programmers to modify the behavior of function or class.
  • Decorators allow us to wrap another function in order to extend the behavior of wrapped function, without permanently modifying it.
  • In Decorators, functions are taken as the argument into another function and then called inside the wrapper function.
  • Decorators are usually called before the definition of a function you want to decorate.
  • A decorator is a function that takes a function as its only parameter and returns a function. This is helpful to “wrap” functionality with the same code over and over again.

Decorators have several use cases such as:

* Authorization in Python frameworks such as Flask and Django
* Logging
* Measuring execution time
* Synchronization

For Reference :

- https://realpython.com/primer-on-python-decorators/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages