_commonstore.py 文件源码

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

项目:provenance 作者: bmabey 项目源码 文件源码
def chained_delete(chained, id, delete=None, contains=op.contains):
    stores_with_delete = [s for s in chained.stores if s._delete]
    if len(stores_with_delete) == 0:
        raise PermissionError('delete', chained, 'delete')

    foundin = []
    for store in stores_with_delete:
        if contains(store, id):
            foundin.append(store)
            if delete:
                delete(store, id)
            else:
                store.delete(id)
    if len(foundin) == 0:
        raise KeyError(id, chained)
    else:
        return foundin
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号