From 3085e8155dc5d00af90f27c935adcee346dba9d6 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Mon, 20 Oct 2025 05:08:15 +0530 Subject: [PATCH] Add __delitem__ for BpfMap in bindings --- src/bindings/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bindings/main.cpp b/src/bindings/main.cpp index ef9d63b..88b718c 100644 --- a/src/bindings/main.cpp +++ b/src/bindings/main.cpp @@ -70,7 +70,8 @@ PYBIND11_MODULE(pylibbpf, m) { .def("get_value_size", &BpfMap::get_value_size) .def("get_max_entries", &BpfMap::get_max_entries) .def("__getitem__", &BpfMap::lookup, py::arg("key")) - .def("__setitem__", &BpfMap::update, py::arg("key"), py::arg("value")); + .def("__setitem__", &BpfMap::update, py::arg("key"), py::arg("value")) + .def("__delitem__", &BpfMap::delete_elem, py::arg("key")); // StructParser py::class_(m, "StructParser")