Skip to content

Remove annotations with deleted FunctionBuilder parameters - #829

Open
Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/remove-argument-annotations
Open

Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/remove-argument-annotations

Conversation

@Gambit-Checkmate

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

Copy link
Copy Markdown

The change

Fixes #828. FunctionBuilder.remove_arg now removes the corresponding annotation after successfully deleting a parameter. Injected wrappers inherit the correction, so their public type hints describe the remaining parameters and return value.

Tests cover annotated positional and keyword-only removal, real wraps(..., injected=...) invocation and get_type_hints, unannotated parameters, and a failed removal preserving metadata.

Validation:

  • Baseline: four regressions fail; two compatibility controls pass.
  • Windows CPython3.13.13 complete unit tests and module doctests: 780 passed, 1 platform skip.
  • Focused source checks pass on Linux CPython3.10.12 and Windows CPython3.11.15/3.12.10/3.14.0; these are not full suites on those interpreters.
  • Python3.7 grammar, Ruff E9/F, sdist/wheel and git diff --check pass.
  • Read the Docs passed. Hosted Tests 45087813423 requires maintainer approval and has0 jobs, so its test suite has not executed.

The backstory

Previous contribution: #824. I found this while following how parameter metadata changes during wrapper construction, and reproduced stale hidden-parameter entries in the compiled wrapper's type hints. This is a source-inspection finding; no personal production incident or independent human review is claimed.

AI assistance

  • Harness/tooling: OpenAI Codex, GitHub CLI, local Python test/build tools.
  • Model(s): GPT-6 as identified by this Codex session.
  • Original prompt(s), relevant excerpts copied verbatim from the recurring contribution request:

没有合适公开 issue 时可以检查代码、复现真实缺陷,确认无重复后报告问题并提交独立修复。

只有改动真实、有依据、验证充分且账号有权限时才推送分支并创建 PR;绝不降低 star 门槛,不提交空改动、无关改动、未经验证或重复 PR,尊重上游 AI 贡献和认领规则。

Codex investigated, implemented and tested the contribution and drafted this description.

This branch has not been deployed

No deployments
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.

remove_arg and injected wrappers retain annotations for removed parameters

1 participant