pybind / pybind/pybind11-stubgen
numpy-array-use-type-var is broken with pybind11 v3.0.0
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 361
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Since 3.0.0, pybind11 produces numpy annotations with typing.Annotated:
- numpy.ndarray[numpy.float64[m, 3]])
+ typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 3]"])
This change was introduced in https://github.com/pybind/pybind11/pull/5212. This breaks the option numpy-array-use-type-var of pybind11-stubgen, which now silently outputs the same as numpy-array-wrap-with-annotated. See PR https://github.com/sizmailov/pybind11-stubgen/pull/263 to track fixes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with pybind11 v3.0.0 and the numpy-array-use-type-var option, then inspect the stub generator's handling of the new typing.Annotated and numpy.typing.NDArray output. Done means this option no longer silently produces the same result as numpy-array-wrap-with-annotated; PR 263 tracks related fixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100