+ 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
+3 -3
View File
@@ -55,7 +55,7 @@ PyObject *TopoShapeCompoundPy::PyMake(struct _typeobject *, PyObject *, PyObject
int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject *pcObj;
if (!PyArg_ParseTuple(args, "O!", &(PyList_Type), &pcObj))
if (!PyArg_ParseTuple(args, "O", &pcObj))
return -1;
BRep_Builder builder;
@@ -63,8 +63,8 @@ int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
builder.MakeCompound(Comp);
try {
Py::List list(pcObj);
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
if (PyObject_TypeCheck((*it).ptr(), &(Part::TopoShapePy::Type))) {
const TopoDS_Shape& sh = static_cast<TopoShapePy*>((*it).ptr())->
getTopoShapePtr()->_Shape;