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.
Problem description
When returning a std::array
, the typing information is invalid, e.g. List[str[2]]
for the code below. This causes tool such as mypy's stubgen or pybind11-stubgen to produce invalid stubs.
I guess it would be valid to generate List[str]
in this case since Python does not have information about the size anyway?
Reproducible example code
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
PYBIND11_MODULE(cpp_module, m)
{
m.def("arr", []() -> std::array<const char*, 2> {
return {"foo", "bar"};
});
}