You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version (or hash if on master) of pybind11 are you using?
master
Problem description
I tested using pybind11-stubgen with the latest pybind11 master. When the native_enum is used in function signatures, pybind11-stubgen cannot "link" the argument to the enum from the module (see this issue). To test if something is "wrong" in pybind11 I wrote following test:
#include<pybind11/native_enum.h>namespacetest {
enumclassfake{ x };
enumclassnative{ x };
}
TEST_SUBMODULE(docstring_options, m) {
// test_docstring_options
{
py::enum_<test::fake>(m, "Fake").value("x", test::fake::x);
py::native_enum<test::native>(m, "Native", "enum.Enum").value("x", test::native::x).finalize();
options.enable_function_signatures();
m.def("test_function_enum", [](test::fake, test::native){}, py::arg("f"), py::arg("n"));
}
}
This fails because the signature of the second argument is "C++-like", i.e. test::native instead of pybind11_tests.docstring_options.Native.
E AssertionError: assert False
E + where False = <built-in method startswith of str object at 0x1179b92c0>('test_function_enum(f: pybind11_tests.docstring_options.Fake, n: pybind11_tests.docstring_options.Native) -> None')
E + where <built-in method startswith of str object at 0x1179b92c0> = 'test_function_enum(f: pybind11_tests.docstring_options.Fake, n: test::native) -> None\n'.startswith
E + where 'test_function_enum(f: pybind11_tests.docstring_options.Fake, n: test::native) -> None\n' = <built-in method test_function_enum of pybind11_detail_function_record_v1_system_libcpp_abi1 object at 0x105b20990>.__doc__
E + where <built-in method test_function_enum of pybind11_detail_function_record_v1_system_libcpp_abi1 object at 0x105b20990> = m.test_function_enum
../../tests/test_docstring_options.py:31: AssertionError
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered:
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
master
Problem description
I tested using pybind11-stubgen with the latest pybind11 master. When the
native_enum
is used in function signatures, pybind11-stubgen cannot "link" the argument to the enum from the module (see this issue). To test if something is "wrong" in pybind11 I wrote following test:and
This fails because the signature of the second argument is "C++-like", i.e.
test::native
instead ofpybind11_tests.docstring_options.Native
.Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: