-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
triageNew bug, unverifiedNew bug, unverified
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?
3.0.2
Problem description
I am having some issues with upgrading to 3.0.2, and it seems to point towards the deprecated pybind11::enum being a contributing factor, so I tried switching to pybind11::native_enum. Most conversion works (and with a bit of additional effort removing py::arithmetic()). But there seems to be a registration problem when used together with py::arg_v() to indicate a default value.
Reproducible example code
py::native_enum<GrRenderable>(m, "GrRenderable", "enum.Enum")
.value("kNo", GrRenderable::kNo)
.value("kYes", GrRenderable::kYes)
.export_values();
...
py::class_<GrRecordingContext, sk_sp<GrRecordingContext>, GrImageContext>(
m, "GrRecordingContext")
.def("defaultBackendFormat", &GrRecordingContext::defaultBackendFormat,
py::arg("colorType"),
py::arg_v("renderable", GrRenderable::kNo, "skia.GrRenderable.kNo"));
...
Is this a regression? Put the last known working version here if it is.
native_enum is new in 3.x
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triageNew bug, unverifiedNew bug, unverified