ITADN

Quality: `deque` missing `__iter__` in micropython-samd-stubs (incompatible with `Iterable` protocol)

#894Closedgithub-actions[bot] 创建于 2026-05-10
invalid
## Problem The `deque` stub is missing `__iter__`, making it incompatible with `Iterable` protocols. This causes false-positive type errors when passing a `deque` to `min()`, `max()`, or `sorted()`. **Affected stub package:** `micropython-samd-stubs` **Stub version:** v1.28.0.post3 **Affected module/symbol:** `collections.deque` — missing `__iter__` method ## Current behavior ``` foo.py:132:18 error Argument of type "deque[Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@min]" in function "min" "deque[Unknown]" is incompatible with protocol "Iterable[...]" — "__iter__" is not present foo.py:133:18 error (same for "max") foo.py:137:25 error (same for "sorted") ``` ## Expected behavior `deque` should implement `__iter__` (and ideally `__len__`, `__contains__`) so it is recognized as an `Iterable` and can be passed to built-in functions like `min()`, `max()`, and `sorted()` without false-positive errors. ## Minimal repro ```python from collections import deque d = deque([1, 2, 3], 10, 1) result = min(d) # error: "deque[Unknown]" is incompatible with Iterable — "__iter__" is not present ``` ## Parent issue See #888 for the original report and full reproduction context. Related to #888 > [!NOTE] > <details> > <summary>🔒 Integrity filter blocked 3 items</summary> > > The following items were blocked because they don't meet the GitHub integrity level. > > - [#733](https://github.com/Josverl/micropython-stubs/issues/733) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". > - [#732](https://github.com/Josverl/micropython-stubs/issues/732) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". > - [#734](https://github.com/Josverl/micropython-stubs/issues/734) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". > > To allow these resources, lower `min-integrity` in your GitHub frontmatter: > > ```yaml > tools: > github: > min-integrity: approved # merged | approved | unapproved | none > ``` > > </details> > Generated by [quality-issue-triage](https://github.com/Josverl/micropython-stubs/actions/runs/25634753244/agentic_workflow) for issue #888 · ● 1.2M · [◷](https://github.com/search?q=repo%3AJosverl%2Fmicropython-stubs+is%3Aissue+%22gh-aw-workflow-call-id%3A+Josverl%2Fmicropython-stubs%2Fquality-issue-triage%22&type=issues) <!-- gh-aw-agentic-workflow: quality-issue-triage, engine: copilot, version: 1.0.40, model: claude-sonnet-4.6, id: 25634753244, workflow_id: quality-issue-triage, run: https://github.com/Josverl/micropython-stubs/actions/runs/25634753244 --> <!-- gh-aw-workflow-id: quality-issue-triage --> <!-- gh-aw-workflow-call-id: Josverl/micropython-stubs/quality-issue-triage -->
关闭于 2026-05-10 0 条评论