improve hybrid property - #6812
Conversation
Greptile SummaryThe PR redesigns hybrid properties as standalone descriptors and improves their frontend typing and class-construction behavior.
Confidence Score: 5/5The PR appears safe to merge. The previously reported decorator binding-copy defect is fixed: every accessor decorator now derives a compatible binding object, and rebinding preserves the getter, setter, deleter, var function, documentation, and target property name.
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/vars/hybrid_property.py | Reimplements HybridProperty without inheriting from property and fixes decorator copying through a binding descriptor that preserves all accessor state. |
| reflex/state.py | Avoids descriptor evaluation during state-class method inspection by traversing class dictionaries directly. |
| packages/reflex-base/src/reflex_base/vars/dep_tracking.py | Treats HybridProperty getters like ordinary property getters during dependency analysis. |
| packages/reflex-base/src/reflex_base/vars/object.py | Handles hybrid properties that explicitly have no frontend value when accessed through ObjectVar. |
| tests/units/vars/test_hybrid_property.py | Adds focused regression tests covering the prior binding-copy failure and the expanded descriptor behavior. |
Reviews (3): Last reviewed commit: "wip" | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
No description provided.