You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type annotations cover 9 of 481 functions (1.9%), all in three recently added game_theory modules (game_converters.py, howson_lcp.py, polymatrix_game.py). New code annotates; old code does not; nothing records which is intended.
The decision has been pending in concrete form for a long time: PR #576 ("Annotate normal_form_game.py") has been open more than five years. Resolving the policy resolves the PR, one way or the other.
Questions for the team
Are annotations expected on new code, welcome but optional, or out of scope?
If expected, is the target the public API surface only, or everything?
Numba-jitted functions have real constraints — annotations on @njit functions are informational and can mislead about what numba actually accepts. Does the policy carve them out?
Is a py.typed marker and a checked mypy job on the roadmap, or would annotations be documentation-only?
Whatever is decided, write it in the contributing guide. The current state is not a wrong decision; it is an unmade one, and the cost falls on contributors who cannot tell whether adding hints will be welcomed or reverted. Close this thread with a summarised decision and spawn concrete follow-ups.
From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).
Update (2026-08-14) after re-reviewing PR #576, which this discussion gates:
The PR was revived in August 2025 (Copilot review, then updates from @rht) and is currently mergeable, with the annotations modernized to int | npt.ArrayLike union syntax. However the current diff has two problems: the return -1 fix for best_response_2p agreed in the 2021 review discussion was dropped in the latest revision (the signature is annotated -> int but the body can still fall through to None, and with no mypy in CI nothing catches the contradiction), and roughly half the diff is accidental Ruff formatting churn that does not match the repo's existing style.
The one piece with standalone value — the best_response_2p fall-through hardening — has been extracted into #936 so it no longer depends on this decision.
That leaves #576 as a pure annotations PR, so the decision here fully determines its fate: if annotations are adopted (with py.typed and a checked mypy job), ask for a clean rebase without the formatting churn; if they are out of scope, close #576 with thanks and a pointer to the recorded decision.
Activity
mmcky commentedon Aug 14, 2026
Update (2026-08-14) after re-reviewing PR #576, which this discussion gates:
The PR was revived in August 2025 (Copilot review, then updates from @rht) and is currently mergeable, with the annotations modernized to
int | npt.ArrayLikeunion syntax. However the current diff has two problems: thereturn -1fix forbest_response_2pagreed in the 2021 review discussion was dropped in the latest revision (the signature is annotated-> intbut the body can still fall through toNone, and with no mypy in CI nothing catches the contradiction), and roughly half the diff is accidental Ruff formatting churn that does not match the repo's existing style.The one piece with standalone value — the
best_response_2pfall-through hardening — has been extracted into #936 so it no longer depends on this decision.That leaves #576 as a pure annotations PR, so the decision here fully determines its fate: if annotations are adopted (with
py.typedand a checked mypy job), ask for a clean rebase without the formatting churn; if they are out of scope, close #576 with thanks and a pointer to the recorded decision.