Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想扫描一个模块(使用dir())并提取type扩展某个父类的类的所有类名(对象)。有没有办法在不首先创建我可以检查的实例的情况下做到这一点isinstance()?
dir()
type
isinstance()
我想你可能正在寻找issubclass
issubclass