converter.py 文件源码

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

项目:sdk_python 作者: bunq 项目源码 文件源码
def _str_to_type_from_member_module(cls, module_, string):
        """
        :type module_: module
        :type string: str

        :rtype: type
        :raise: BunqException when could not find the class for the string.
        """

        module_name_short, class_name = string.split(cls._DELIMITER_MODULE)
        members = inspect.getmembers(module_, inspect.ismodule)

        for name, module_member in members:
            if module_name_short == name:
                return getattr(module_member, class_name)

        error_message = cls._ERROR_COULD_NOT_FIND_CLASS.format(string)

        raise exception.BunqException(error_message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号