What does the @property decorator do in a Python class?

Python Developer Medium

Python Developer — Medium

What does the @property decorator do in a Python class?

Key points

  • @property decorator allows you to access a method as an attribute
  • It provides a more intuitive way to work with class methods
  • This decorator is commonly used for getter methods in Python classes

Ready to go further?

Related questions