add 'items' to Flags, for same behavior as dict

This commit is contained in:
Joachim Schoeberl 2024-05-05 21:40:47 +02:00
parent 331e47830e
commit bb2989e1c5

View File

@ -195,6 +195,10 @@ PYBIND11_MODULE(pyngcore, m) // NOLINT
{ {
return CreateDictFromFlags(flags); return CreateDictFromFlags(flags);
}) })
.def("items", [](const Flags& flags)
{
return CreateDictFromFlags(flags).attr("items")();
})
; ;
py::implicitly_convertible<py::dict, Flags>(); py::implicitly_convertible<py::dict, Flags>();