loadables.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:zun 作者: openstack 项目源码 文件源码
def _get_classes_from_module(self, module_name):
        """Get the classes from a module that match the type we want."""
        classes = []
        module = importutils.import_module(module_name)
        for obj_name in dir(module):
            # Skip objects that are meant to be private.
            if obj_name.startswith('_'):
                continue
            itm = getattr(module, obj_name)
            if self._is_correct_class(itm):
                classes.append(itm)
        return classes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号