Backend
类型: 类
领域: 核心运行时
推荐导入: from cadflow.backend import Backend
签名
class Backend(*args, **kwargs)
功能说明
Backend 是 CadFlow 核心运行时领域的公共类。
原始 API 说明
Base class for protocol classes.
Protocol classes are defined as::
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example::
class C: def meth(self) -> int: return 0
def func(x: Proto) -> int: return x.meth()
func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as::
class GenProto(Protocol[T]): def meth(self) -> T: ...
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
args | Any | 否 | - | 源码 Docstring 未单独说明。 |
kwargs | Any | 否 | - | 源码 Docstring 未单独说明。 |
返回值
类型: Any
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
公共成员
| 成员 | 类型 | 签名 | 说明 |
|---|---|---|---|
call | method | (self, operation: 'str', *args: 'Any', **kwargs: 'Any') -> 'Any' | 见成员签名。 |
supports | method | (self, operation: 'str') -> 'bool' | 见成员签名。 |
行为与约束
- 以下契约由当前公共运行时签名生成;所有权与工作流限制见对应领域说明。
导入检查
from cadflow.backend import Backend