config.basic._generate_operators

辅助生成

在 0.2.0 版本加入.

Functions

generate(→ type[generate.C])

为类生成操作符

operate(→ collections.abc.Callable[[operate.F], operate.F])

将方法标记为需要生成标记符

Module Contents

generate(cls: type[generate.C]) type[generate.C]

为类生成操作符

需要使用 @operate 装饰器标记要自动生成的操作符

参数:

cls (type[C]) -- 目标类

返回:

原样返回类

返回类型:

type[C]

operate(operate_func: Operator, inplace_func: InplaceOperator[Any]) collections.abc.Callable[[operate.F], operate.F]

将方法标记为需要生成标记符

参数:
  • operate_func (Operator) -- 操作函数

  • inplace_func (InplaceOperator[Any]) -- 原地操作函数

返回:

装饰器

返回类型:

Callable[[F], F]