Python · 可调用对象

是否子类

Return whether 'cls' is derived from another class or is the same class.

调用签名(cls, class_or_tuple, /)
ZHONGWEN
PYTHON
Chinese example

中文代码示例

# 案例:查看 是否子类 的入口
设 功能 = 是否子类
打印(功能)
可直接放进 .cs / .中py 文件运行。转换器会把中文代码交给真实 Python 解释器。
Parameters

参数说明

1 个参数
参数类型 / 传入方式说明
class_or_tuple可选 · 默认 无
未声明位置参数,按顺序直接传值

按函数业务含义传入 class_or_tuple;首次使用建议先 打印(结果) 确认其作用。

常见错误:漏传会报 TypeError: missing required argument: 'class_or_tuple';检查调用是否漏了这行
Playbook

基础用法 · 进阶组合 · 错误排查

# 案例:查看 是否子类 的入口
设 功能 = 是否子类
打印(功能)