python - 在 python 中,是否有与 isinstance 等效的静态?

标签 python inheritance static isinstance

我想扫描一个模块(使用dir())并提取扩展某个父类的类的所有类名(type 对象)。 有没有什么方法可以在不首先创建我可以使用 isinstance() 检查的实例的情况下执行此操作?

最佳答案

我想您可能正在寻找 issubclass

关于python - 在 python 中,是否有与 isinstance 等效的静态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14523167/

相关文章:

python - 在圆环图中隐藏低百分比

c++ - 在静态函数中调用成员函数指针

java - 为什么java常量声明为静态的?

oop - Dlang : why are constructors not inherieted?

c - 使用错误值初始化的静态变量

python - 从列表中获取相对于 python 中另一个元素的元素

Python检查一个项目是否在列表中

python - 转换python espeak + subprocess代码直接播放输出音频

java - JMockit测试类继承: mocked fields not injected when declared in parent class

C# - 如何复制/创建对象作为后代