附属函数参数修改

This commit is contained in:
UnCLAS-Prommer
2025-08-21 00:46:04 +08:00
parent e1a21c5a45
commit e8922672aa
11 changed files with 292 additions and 337 deletions

View File

@@ -1,5 +1,5 @@
import copy
from typing import Dict, Any
from typing import Any
class BaseDataModel:
@@ -7,6 +7,7 @@ class BaseDataModel:
return copy.deepcopy(self)
def temporarily_transform_class_to_dict(obj: Any) -> Any:
# sourcery skip: assign-if-exp, reintroduce-else
"""
将对象或容器中的 BaseDataModel 子类(类对象)或 BaseDataModel 实例
递归转换为普通 dict不修改原对象。