1 // mds_utils/python/list.i
3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
5 // Distributed under the MIT License (See accompanying file LICENSE)
7 %include "mds_utils/python/obj.i"
11 #include <mds_utils/python/list.hpp>
15 %typemap(in) (mds_utils::python::List) {
17 if (!PyList_Check($input)) {
18 throw std::invalid_argument("The list argument is not a list.");
21 } catch (std::exception& e) {
22 PyErr_SetString(PyExc_RuntimeError,e.what());
27 %typemap(out) mds_utils::python::List = mds_utils::python::Obj;
29 %typecheck(SWIG_TYPECHECK_POINTER) mds_utils::python::Sequence {
30 $1 = PyList_Check($input);