dry-python / dry-python/returns

Think about lazy loop method

未关闭
#647 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement help wanted
主要语言
Python
星标
4.4k
派生
155
平均合并
2 小时 27 分钟
30 天内合并 PR
22

描述

Imagine that you have a list of 3 elements. And you are going to use `Fold.loop` on it.
The first one is `Failure(1)`.

Currently, `loop` will iterate over all 3 elements. With no breakpoints.
But, `Failure(1)` is a roadblock for any other logic. We should not iterate over other values.

We need to think about best solutions here.
Criteria:

- It should ideally work with any `FailableN`
- It should be similar to `loop` in semantics
- It should be possible to use `loop` or `loop_lazily` on the same functions / helpers. In other words, it should be easy to switch from one to another
- It should be faster than `loop`

Ideas?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。