+ Make Python API more pythonic

This commit is contained in:
wmayer
2013-10-11 13:57:05 +02:00
parent 890d454eca
commit 4686118f2a
20 changed files with 255 additions and 256 deletions

View File

@@ -503,9 +503,9 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
}
par.push_back(val);
}
else if (PyList_Check(float_or_list)) {
Py::List list(float_or_list);
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
else if (PySequence_Check(float_or_list)) {
Py::Sequence list(float_or_list);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
double val = (double)Py::Float(*it);
if (val == f || val == l) {
PyErr_SetString(PyExc_ValueError, "Cannot split edge at start or end point");