> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python Property Decorator

The `@property` decorator is a built-in Python class that implements the descriptor protocol (`__get__`, `__set__`, and `__delete__`) to transform a class method into an attribute. When applied, it binds the decorated method to the property's internal getter, allowing the method to be accessed via standard dot notation without invocation parentheses.

## Syntax and Structure

The property decorator ecosystem consists of three distinct decorators, all of which must share the exact same method name:

```python theme={"dark"}
class Entity:
    def __init__(self):
        self._attribute = None

    @property
    def attribute(self):
        # Acts as the getter (fget)
        return self._attribute

    @attribute.setter
    def attribute(self, value):
        # Acts as the setter (fset)
        self._attribute = value

    @attribute.deleter
    def attribute(self):
        # Acts as the deleter (fdel)
        del self._attribute
```

## Mechanical Breakdown

Under the hood, `@property` is not a standard function decorator, but a built-in type. The decorator syntax is syntactic sugar for instantiating the `property` class, which possesses the following signature:

```python theme={"dark"}
property(fget=None, fset=None, fdel=None, doc=None)
```

1. **`@property` (Getter):** Decorating a method with `@property` creates a new `property` object, passing the decorated method as the `fget` argument. If only this decorator is used, the resulting attribute is read-only.
2. **`@<name>.setter`:** The `property` object exposes a `.setter()` method. This method acts as a decorator that returns a *new* copy of the property object, retaining the existing `fget` while populating the `fset` argument with the newly decorated method.
3. **`@<name>.deleter`:** Similarly, the `.deleter()` method returns a new property object with the `fdel` argument populated by the decorated method.

## Functional Equivalence

To understand the decorator's internal routing, the decorator syntax is functionally identical to explicitly assigning the `property()` class to a class-level variable:

```python theme={"dark"}
class Entity:
    def __init__(self):
        self._attribute = None

    def get_attribute(self):
        return self._attribute

    def set_attribute(self, value):
        self._attribute = value

    def del_attribute(self):
        del self._attribute

    # Explicit descriptor instantiation
    attribute = property(fget=get_attribute, fset=set_attribute, fdel=del_attribute)
```

## Descriptor Protocol Routing

When an instance accesses `instance.attribute`, Python's attribute lookup mechanism (`__getattribute__`) detects that `attribute` is a descriptor (because the `property` object implements `__get__`).

Instead of returning the `property` object itself in memory, Python intercepts the lookup and invokes the descriptor's `__get__` method, which executes the function bound to `fget`. The same routing applies to assignment operations, which trigger `__set__` and route to `fset`, and `del` operations, which trigger `__delete__` and route to `fdel`.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Python Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
