Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Replace Iterable with Collection/Sequence, remove stale type: ignore#576

Open
ecomodeller wants to merge 1 commit intomain from
refactor/replace-iterable-type-hints
Open

Replace Iterable with Collection/Sequence, remove stale type: ignore #576
ecomodeller wants to merge 1 commit intomain from
refactor/replace-iterable-type-hints

Conversation

@ecomodeller
Copy link
Member

@ecomodeller ecomodeller commented Feb 12, 2026
edited
Loading

Summary

  • Replace Iterable type hints with Collection (unordered: by, mod_items, comparers) and Sequence (ordered: metrics, obs/mod lists) for more precise API contracts
  • Remove 49 unused # type: ignore comments confirmed stale by mypy --warn-unused-ignores

Why

Iterable accepts single-pass iterators (generators) which would silently break code that iterates multiple times (e.g. ComparerCollection.__init__). Collection and Sequence better express the actual requirements and help downstream users relying on static type checking. Removing stale type: ignore comments ensures future type errors aren't silently suppressed.

...ore comments
Use Collection for unordered containers (by, mod_items, aux_items, comparers)
and Sequence for ordered ones (metrics, obs/mod lists). Remove 49 unused
type: ignore comments confirmed stale by mypy --warn-unused-ignores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /