add first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Awaitable, List
|
||||
import modelvault
|
||||
|
||||
# 初始定义(可以保留 db 作为示例)
|
||||
db: modelvault.AsyncDatabase | None = None # type: ignore
|
||||
|
||||
def set_global_var(name: str, value: Any) -> None:
|
||||
"""
|
||||
设置当前模块的全局变量。
|
||||
|
||||
Args:
|
||||
name: 变量名(字符串)
|
||||
value: 任意值
|
||||
"""
|
||||
globals()[name] = value
|
||||
|
||||
|
||||
|
||||
# 但这样会污染导出列表,不推荐自动添加。
|
||||
__all__ = [
|
||||
"db",
|
||||
"set_global_var",
|
||||
]
|
||||
Reference in New Issue
Block a user