parsiflage.py 文件源码

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

项目:tailbiter 作者: darius 项目源码 文件源码
def maybe_assignment(*expr_fns):
    if len(expr_fns) == 1:
        node0 = expr_fns[0](ast.Load())
        stmt = ast.Expr(node0)
    else:
        lhses = [fn(ast.Store()) for fn in expr_fns[:-1]]
        node0 = lhses[0]
        stmt = ast.Assign(lhses, expr_fns[-1](ast.Load()))
    return ast.copy_location(stmt, node0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号