mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
renamed pybind11::set::insert -> add to match C api naming
This commit is contained in:
parent
333e889ef2
commit
3ee91b2f0a
@ -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()); }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user