Closed
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
Problem description
A number of the type hints have been updated for never versions of Python but are now incorrect for older versions of Python.
An example is collections.abc.Buffer
which was added in Python 3.12 however there are many more examples.
If an extension is compiled against an older version of Python the stub files generated will be incorrect for that version and a static type checker will correctly throw errors.
I would expect the type hints to be correct for the version of Python the extension was compiled against regardless of which version it is.
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression