From 3ee91b2f0aa24480bd215c0dbd1b8917d89c7e0f Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 15 Nov 2015 13:03:07 +0100 Subject: [PATCH] renamed pybind11::set::insert -> add to match C api naming --- example/example2.cpp | 4 ++-- include/pybind11/pytypes.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/example2.cpp b/example/example2.cpp index 2e20e8b33..647427b83 100644 --- a/example/example2.cpp +++ b/example/example2.cpp @@ -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; } diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 3baecf8b3..c319e8e50 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -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()); } };