dry-python / dry-python/returns

Think about lazy loop method

Aperta
#647 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement help wanted
Lingua principale
Python
Stelle
4.4k
Fork
155
Merge medio
2h 27m
PR unite (30g)
22

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.