Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 617 Bytes

File metadata and controls

26 lines (20 loc) · 617 Bytes

Decorator

  • A decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.

Decorator as function

  • code

  • Run this from your shell:

    python decorator_as_function.py

Decorator as class

  • code
  • Run this from your shell:
    python decorator_as_class.py

Examples