hwsim.py 文件源码

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

项目:pyha 作者: gasparka 项目源码 文件源码
def is_convertible(obj):
    allowed_types = [ComplexSfix, Sfix, int, bool, Const]
    if type(obj) in allowed_types:
        return True
    elif isinstance(obj, list):
        # To check whether all elements are of the same type
        if len(set(map(type, obj))) == 1:
            if all(type(x) in allowed_types for x in obj):
                return True
            elif isinstance(obj[0], HW):  # list of submodules
                return True
    elif isinstance(obj, Enum):
        return True
    elif isinstance(obj, HW):
        return True

    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号