🔵 🔵 🔵


Primary

၊၊||၊|။

❪֎ₐ'❫ Python Decorators ○|Definition|1st|20260110153102-00-⌔

Glossary — Python 3 documentation#term-decorator

decorator

A function returning another function, usually applied as a function transformation using the @wrapper syntax. Common examples for decorators are classmethod() and staticmethod().

The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent:

def f(arg):
   ...
f = staticmethod(f)
 
@staticmethod
def f(arg):
   ...

The same concept exists for classes, but is less commonly used there. See the documentation for function definitions and class definitions for more about decorators.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •