Skip to content

fix(types): Buffer type hint - #5662

Merged
henryiii merged 8 commits into
pybind:masterfrom
gentlegiantJGC:impr-type-hints
May 14, 2025
Merged

henryiii merged 8 commits into
pybind:masterfrom
gentlegiantJGC:impr-type-hints

Conversation

@gentlegiantJGC

@gentlegiantJGC gentlegiantJGC commented May 14, 2025 •

Copy link
Copy Markdown
Contributor

Description

Fix a type hint regression introduced in #5566.
collections.abc.Buffer was added in Python 3.12.
If the Python version being compiled against is less than this it uses typing_extensions.Buffer.

Fixes #5660

Suggested changelog entry:

Fix Buffer type hint

@henryiii
henryiii merged commit 6aa3b33 into pybind:master May 14, 2025
@henryiii henryiii changed the title Fix Buffer type hint fix(typing): Buffer type hint May 14, 2025
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label May 14, 2025
@gentlegiantJGC
gentlegiantJGC deleted the impr-type-hints branch May 14, 2025 14:48
@henryiii henryiii changed the title fix(typing): Buffer type hint fix(types): Buffer type hint May 17, 2025
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label May 17, 2025
aaron-skydio added a commit to symforce-org/symforce that referenced this pull request Sep 30, 2026
3.0.0 replaced CLIArgs.module_name with module_names, and run() now takes
the module names and output dir directly.  The symforce wheel tests
install the unpinned dev extras, so they picked up 3.0.0 and the cc_sym
stubs codegen test failed.

Update both stubgen callers to the new API and require >=3.0.0.  Value
comments are now opt-in, so pass --print-value-comments to keep them.

Remove monkeypatches that are now redundant.  Current-module prefix
stripping and nested-parameter imports are handled upstream in 3.0.0.
The typing.Buffer -> typing_extensions.Buffer rewrite is unneeded since
pybind11 3.0.0 (pybind/pybind11#5662) never emits typing.Buffer.
Regenerating with each of these disabled produces no change.

Topic: pybind11-stubgen-3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aaron Miller <aaron@skydio.com>
GitOrigin-RevId: a5f55ed3319031e4f580e650bc2022e9a05af47b
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.

[BUG]: Incorrect type hints for older versions

2 participants