Skip to content

Correct introspection helper return types in bundled stubs - #193

Open
xiehuanyi wants to merge 1 commit into
micheles:masterfrom
xiehuanyi:fix-inspection-helper-stubs
Open

xiehuanyi wants to merge 1 commit into
micheles:masterfrom
xiehuanyi:fix-inspection-helper-stubs

Conversation

@xiehuanyi

Copy link
Copy Markdown

The bundled stubs label inspect_sig() as returning FullArgSpec and getfullargspec() as returning a plain tuple. This rejects valid uses of Signature.bind() and named argument-spec fields.

Use the actual return types, declare the FullArgSpec fields, and mirror the pre-3.14 inspect.signature alias. The runtime implementation is unchanged.

Validation: an external typing example reports eight errors before and passes with mypy/Pyright afterward. All 28 unit tests and 118 doctest examples pass; stubtest passes on Python 3.12 and 3.15. The CI source-mypy command passes on Python 3.15, and configured codespell/Flake8 checks pass.

Prepared and verified with Codex (GPT-6.1-sol) assistance.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants