We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 333e889 commit 3ee91b2Copy full SHA for 3ee91b2
example/example2.cpp
@@ -30,8 +30,8 @@ class Example2 {
30
/* Create and return a Python set */
31
py::set get_set() {
32
py::set set;
33
- set.insert(py::str("key1"));
34
- set.insert(py::str("key2"));
+ set.add(py::str("key1"));
+ set.add(py::str("key2"));
35
return set;
36
}
37
include/pybind11/pytypes.h
@@ -337,7 +337,7 @@ class set : public object {
337
PYBIND11_OBJECT(set, object, PySet_Check)
338
set() : object(PySet_New(nullptr), false) { }
339
size_t size() const { return (size_t) PySet_Size(m_ptr); }
340
- void insert(const object &object) { PySet_Add(m_ptr, (PyObject *) object.ptr()); }
+ void add(const object &object) { PySet_Add(m_ptr, (PyObject *) object.ptr()); }
341
void clear() { PySet_Clear(ptr()); }
342
};
343
0 commit comments