ITADN

Quality: deque missing __iter__ — not compatible with Iterable protocol

#896Closedgithub-actions[bot] 创建于 2026-05-10
invalidQualityscope:port:samd
## Problem The `deque` stub in `micropython-samd-stubs` (and likely other ports) does not define `__iter__`, making it incompatible with the `Iterable` protocol. This causes false-positive type errors when passing a `deque` to built-in functions such as `min()`, `max()`, and `sorted()`. ## Affected stub package / version - **Package:** `micropython-samd-stubs` - **Version:** `v1.28.0.post3` ## Affected module / symbol - Module: `collections` (or `ucollections`) - Class: `deque` - Missing method: `__iter__` ## Current behavior Pyright reports: ``` "deque[Unknown]" is incompatible with protocol "Iterable[SupportsRichComparisonT@min]" "__iter__" is not present ``` Same error for `max` and `sorted`. ## Expected behavior `deque` should declare `__iter__` so it satisfies the `Iterable[T]` protocol, allowing idiomatic code like `min(self._deque)` to type-check without errors. ## Parent issue Reported in #888 Related to #888 > Generated by [quality-issue-triage](https://github.com/Josverl/micropython-stubs/actions/runs/25634753270/agentic_workflow) for issue #888 · ● 155.9K · [◷](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: 25634753270, workflow_id: quality-issue-triage, run: https://github.com/Josverl/micropython-stubs/actions/runs/25634753270 --> <!-- gh-aw-workflow-id: quality-issue-triage --> <!-- gh-aw-workflow-call-id: Josverl/micropython-stubs/quality-issue-triage -->
关闭于 2026-05-10 1 条评论