Skip to content

Commit

Permalink
renamed pybind11::set::insert -> add to match C api naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel Jakob committed Nov 15, 2015
1 parent 333e889 commit 3ee91b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/example2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Example2 {
/* 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;
}

Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class set : public object {
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()); }
};

Expand Down

0 comments on commit 3ee91b2

Please sign in to comment.