diff --git a/objects.h b/objects.h index 9f15284c..250fe62d 100644 --- a/objects.h +++ b/objects.h @@ -35,7 +35,7 @@ class Object class Tuple : public Object { public: - Tuple(std::size_t n = 0); + explicit Tuple(std::size_t n = 0); explicit Tuple(Ptr p); template @@ -63,6 +63,16 @@ class Tuple : public Object set_item(2, Ptr(to_python(third))); } + template + Tuple(const First& first, const Second& second, const Third& third, const Fourth& fourth) + : Object(Ptr(PyTuple_New(4))) + { + set_item(0, Ptr(to_python(first))); + set_item(1, Ptr(to_python(second))); + set_item(2, Ptr(to_python(third))); + set_item(3, Ptr(to_python(fourth))); + } + static PyTypeObject* type_object(); static bool accepts(Ptr p); std::size_t size() const;