feat: add set_cached_property function to manage cached properties

This commit is contained in:
2026-07-06 22:40:32 +08:00
parent 2504a03680
commit c793672933
+12
View File
@@ -123,6 +123,18 @@ def has_cached_property(obj, name):
return name in obj.__dict__
def set_cached_property(obj, name, value):
"""
Set a cached property.
Args:
obj:
name (str):
value:
"""
obj.__dict__[name] = value
def function_drop(rate=0.5, default=None):
"""
Drop function calls to simulate random emulator stuck, for testing purpose.