Skip to content

Describe transposed columns in unzip return types - #404

Merged
dgilland merged 2 commits into
dgilland:developfrom
Gambit-Checkmate:fix/unzip-column-types
Nov 1, 2026
Merged

dgilland merged 2 commits into
dgilland:developfrom
Gambit-Checkmate:fix/unzip-column-types

Conversation

@Gambit-Checkmate

@Gambit-Checkmate Gambit-Checkmate commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #403.

Correct the four fixed-width tuple overloads of unzip to describe the transposed columns. For example, three (int, str) rows produce an integer column and a string column of length three, so the result is list[tuple[int, ...] | tuple[str, ...]], rather than list[tuple[int, str]].

  • Preserve each column's element type and allow its length to depend on the row count, for input widths 2–5.
  • Regenerate the chain signatures and update the affected homogeneous unzip type expectation.
  • Use a local Sequence variable in zip_object_deep for resolved columns. The corrected producer type exposes that columns can be tuples; this avoids assigning them back into the list-annotated input parameter. Its public signature and runtime behavior are unchanged.
  • Add focused type/runtime regression checks and an unreleased changelog entry; the existing AUTHORS credit is retained.

This does not change runtime transposition, tuple/list padding behavior, the generic fallback overload or unzip_with's separate annotations.

Validation

Windows / CPython 3.13.13:

  • Four new mypy checks fail on pristine develop 6d33598, while their four runtime checks pass.
  • After the fix, 10 focused type/runtime checks pass, including the existing homogeneous control. Cases cover widths 2–5, differing row counts, an iterator and chaining.
  • Full unit/doctest suite: 3,079 passed, 100% coverage.
  • Full source/test/task mypy check, Ruff lint and formatting, Sphinx with warnings as errors, source distribution/wheel builds and git diff --check: passed.
  • Fresh generated chain signatures match the checked-in stub.

Other Python versions/platforms were not run locally. Hosted Main run 41269968401 passed on the submitted head: Python 3.10–3.14 and Finish Coveralls all succeeded.

Origin and assistance

Found by code inspection, not a production incident. Checked the current open PR inventory and all-state unzip searches, including the original #222 tuple API change, before reporting the distinct annotation problem.

OpenAI Codex (GPT-6 family; exact deployment identifier unavailable) assisted with investigation, implementation and verification. The user requested independently useful, tested open-source fixes and explicit avoidance of duplicate contributions; no independent human review is claimed.

@coveralls

coveralls commented Nov 1, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — Gambit-Checkmate:fix/unzip-column-types into dgilland:develop

@dgilland
dgilland merged commit aed48cf into dgilland:develop Nov 1, 2026
5 checks passed
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.

unzip tuple return annotations describe rows rather than columns

3 participants