Skip to content

How to delete a key from pybind11::dict #3889

Answered by Skylion007
tp-nan asked this question in Q&A
Discussion options

You must be logged in to vote

You can access any Python functions or attributes through the attr methods.

py::dict d;
d["key"] = "value";
auto discarded_val = d.attr("pop")("key");

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tp-nan
Comment options

Answer selected by Skylion007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants