dry-python / dry-python/returns

Consider adding LazyIO and friends

オープン
#525 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
4.4k
フォーク
155
平均マージ
2時間 27分
マージ済み PR(30日)
22

説明

The thing about `IO` in multiple languages / libraries is that it is lazy.

Our `IO` is not lazy by design. It is done, so Python developers can use it like so: `impure(print)(1) # prints "1"`
But, we also need to think about other problems as well:
1. Retries, with proper lazy `IO` one can retry an operation as many times as one wishes: `p = impure_lazy(print)(1); p(); p() # prints "1" twice`
2. Semantical identity to `Future`, currently it is not similar to regular `IO`, because `Future`s are lazy: they don't run until they are executed properly
3. New users will find the similar data-type they already know from other languages / libraries

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、既存の IO と Future の実装および impure API を読みます。issue では特定のファイルは指定されていません。それらの評価動作を比較し、retry のセマンティクスと Future との相互作用を含む、意図する LazyIO API を定義します。遅延実行と繰り返しの呼び出しを実証する、合意済みの設計とテストがあれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。