Commit 3ee91b2f by Wenzel Jakob

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

parent 333e889e
...@@ -30,8 +30,8 @@ public: ...@@ -30,8 +30,8 @@ public:
/* Create and return a Python set */ /* Create and return a Python set */
py::set get_set() { py::set get_set() {
py::set set; py::set set;
set.insert(py::str("key1")); set.add(py::str("key1"));
set.insert(py::str("key2")); set.add(py::str("key2"));
return set; return set;
} }
......
...@@ -337,7 +337,7 @@ public: ...@@ -337,7 +337,7 @@ public:
PYBIND11_OBJECT(set, object, PySet_Check) PYBIND11_OBJECT(set, object, PySet_Check)
set() : object(PySet_New(nullptr), false) { } set() : object(PySet_New(nullptr), false) { }
size_t size() const { return (size_t) PySet_Size(m_ptr); } 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()); } 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