From bd0f77d8c20b2220071d838af8e3aa792d82fead Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Sat, 14 Dec 2024 21:28:23 +0100 Subject: [PATCH] add fast path for BaseState.__getattribute__ dunder access --- reflex/state.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reflex/state.py b/reflex/state.py index 9fd5d2503..9c5cd987b 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1240,6 +1240,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if not super().__getattribute__("__dict__"): return super().__getattribute__(name) + # Fast path for dunder + if name.startswith("__"): + return super().__getattribute__(name) + # For now, handle router_data updates as a special case. if ( name == constants.ROUTER_DATA