Skip to content

chore: parameterize bare list/tuple generics; enforce disallow_any_generics - #6

Merged
Xof merged 1 commit into
mainfrom
chore/typing-generics
Jun 21, 2026
Merged

chore: parameterize bare list/tuple generics; enforce disallow_any_generics#6
Xof merged 1 commit into
mainfrom
chore/typing-generics

Conversation

@Xof

@Xof Xof commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

P5 typing (closes T1)

A py.typed package should not leak implicit-Any element types to consumers.

Fix: parameterize the three bare generics in engine.py public
signatures:

  • Dialect.format_params(params: list)list[Any]
  • Engine.create(..., rows: list[tuple] | None)list[tuple[Any, ...]] | None
  • Engine._insert_rows(..., rows: list[tuple])list[tuple[Any, ...]]

Pure annotation change; no runtime behavior. The whole package is clean under
mypy --disallow-any-generics, so this PR also enables disallow_any_generics
in [tool.mypy] — bare list/dict/tuple now fail CI, preventing silent
regression. (The predicates .sql() methods that previously carried bare
list returns were removed in #4.)

No new tests — annotation-only. Local gate green: ruff, mypy (with the new
flag), pytest (113 passed, 15 skipped).

…nerics

T1: A py.typed package should not leak implicit-Any element types to
consumers. Parameterize the three bare generics in engine.py public
signatures (format_params, create, _insert_rows) to list[Any] /
list[tuple[Any, ...]], and enable mypy's disallow_any_generics so the
generics cannot silently regress. Pure annotation change; no runtime effect.

Closes T1.
@Xof
Xof merged commit 7cbba01 into main Jun 21, 2026
5 checks passed
@Xof
Xof deleted the chore/typing-generics branch June 21, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant