Python Decorator Concept

#python #designpattern #programming #decorator #theory #tip

  • Is a type of Callable Objects
  • The objective: Decorate another function and take this function as argument
  • Most part of the decorators change the function decorated
  • Decorators are defined in one module and used and other modules as well
  • They run on the step of import time
Quote
  • A decorator is a function or another callable
  • A decorator may replace decorated function with a different one
  • Decorators are executed immediately when a module is loaded
    Ramalho, 2022, p306

References

  • Ramalho, 2022, p302-307
#python #designpattern #programming #decorator #theory #tip