What does the “at” (@) symbol do in Python?

What does the @ symbol do in Python?

14 s
14

An @ symbol at the beginning of a line is used for class and function decorators:

  • PEP 318: Decorators
  • Python Decorators

The most common Python decorators are:

  • @property
  • @classmethod
  • @staticmethod

An @ in the middle of a line is probably matrix multiplication:

  • @ as a binary operator.

Leave a Comment