Merge branch 'automatic_flags_to_dict' into 'master'

Add Flags.keys() in Python, for working dict(flags)

See merge request ngsolve/netgen!584
This commit is contained in:
Hochsteger, Matthias 2023-07-19 19:22:34 +02:00
commit caa8912d7f

View File

@ -165,6 +165,9 @@ PYBIND11_MODULE(pyngcore, m) // NOLINT
return self;
}, py::arg("akey"), py::arg("value"), "Set flag by given value.")
.def("keys", [](Flags & self) -> py::list {
return CreateDictFromFlags(self).attr("keys")();
})
.def("__getitem__", [](Flags & self, const string& name) -> py::object {
if(self.NumListFlagDefined(name))