Commit 3ee91b2f by Wenzel Jakob

renamed pybind11::set::insert -> add to match C api naming

parent 333e889e
......@@ -30,8 +30,8 @@ public:
/* Create and return a Python set */
py::set get_set() {
py::set set;
set.insert(py::str("key1"));
set.insert(py::str("key2"));
set.add(py::str("key1"));
set.add(py::str("key2"));
return set;
}
......
......@@ -337,7 +337,7 @@ public:
PYBIND11_OBJECT(set, object, PySet_Check)
set() : object(PySet_New(nullptr), false) { }
size_t size() const { return (size_t) PySet_Size(m_ptr); }
void insert(const object &object) { PySet_Add(m_ptr, (PyObject *) object.ptr()); }
void add(const object &object) { PySet_Add(m_ptr, (PyObject *) object.ptr()); }
void clear() { PySet_Clear(ptr()); }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment