add fast path for BaseState.__getattribute__ dunder access

This commit is contained in:
Benedikt Bartscher 2024-12-14 21:28:23 +01:00
parent d3f1b8954d
commit bd0f77d8c2
No known key found for this signature in database

View File

@ -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