require_iterable_of loses invalid elements in one-shot iterators
まだ誰も着手していません。
評価
調査の方向性
まず require_iterable_of とそのイテラブル検証の経路を確認し、既存のテストに再利用可能なシーケンスがあるか調べます。issue に示されたジェネレーターで失敗を再現し、有効なジェネレーターと無効なジェネレーターの回帰テストを追加します。ワンショットイテレーターが元の要素インデックスを含む指定の TypeError を送出し、有効なジェネレーターが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
require_iterable_of(iter([1, "bad", 3]), int) raises AssertionError("Shouldn't reach here.") rather than the documented named TypeError. The fast all() consumes the invalid item, and the second traversal sees only the remaining values. A list correctly reports the mismatched element.
Reproduce with the current default branch:
from typechecks import require_iterable_of
require_iterable_of(iter([1, "bad", 3]), int, name="items")
Validate one-shot iterators in a single traversal, preserving the original element index and named error; add a regression covering valid/invalid generators. The documentation PR explicitly describes the current reusable-sequence limitation rather than claiming generators are supported.
- 主要言語
- Python
- スター
- 0
- フォーク
- 1
- 平均マージ
- 4分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openvax/typechecks のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
openvax/typechecks#5 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
openvax/typechecks#2 ·
openvax/typechecks の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pearu/agent-sandbox#451 ·
メンテナーはふだん 1 日以内に返信
-
run_gate loads a custom tasks file from outside the working directory対応中かも @Ru0k3 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MakazhanAlpamys/Soup#3189 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NYCPlanning/data-engineering#2996 ·
メンテナーはふだん 1 日以内に返信