|
SyFi
0.3
|
Static Public Member Functions | |
| static Type | as (PyObject *obj, bool throw_error) |
Definition at line 3982 of file SyFiPYTHON_wrap.cxx.
| static Type swig::traits_as< Type, value_category >::as | ( | PyObject * | obj, |
| bool | throw_error | ||
| ) | [inline, static] |
Definition at line 3983 of file SyFiPYTHON_wrap.cxx.
References swig::asval(), SWIG_Error, SWIG_IsOK, SWIG_TypeError, and test_syfi::debug::v.
{
Type v;
int res = asval(obj, &v);
if (!obj || !SWIG_IsOK(res)) {
if (!PyErr_Occurred()) {
::SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
}
if (throw_error) throw std::invalid_argument("bad type");
}
return v;
}