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

This commit is contained in:
Wenzel Jakob 2015-11-15 13:03:07 +01:00
parent 333e889ef2
commit 3ee91b2f0a
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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()); }
};