Mercurial > hg > vampy
comparison PyTypeInterface.cpp @ 41:94d09b4027aa
* Merge r1089 from earlier vampy2 branch
author | cannam |
---|---|
date | Mon, 05 Oct 2009 12:51:08 +0000 |
parents | 27bab3a16c9a |
children | af9c4cee95a8 |
comparison
equal
deleted
inserted
replaced
40:e06c3488314a | 41:94d09b4027aa |
---|---|
130 Py_DECREF(pyFloat); | 130 Py_DECREF(pyFloat); |
131 return rValue; | 131 return rValue; |
132 } | 132 } |
133 | 133 |
134 // convert the first element of any iterable sequence (for convenience and backwards compatibility) | 134 // convert the first element of any iterable sequence (for convenience and backwards compatibility) |
135 if (PySequence_Check(pyValue) and PySequence_Size(pyValue) > 0) | 135 if (PySequence_Check(pyValue) && PySequence_Size(pyValue) > 0) |
136 { | 136 { |
137 PyObject* item = PySequence_GetItem(pyValue,0); | 137 PyObject* item = PySequence_GetItem(pyValue,0); |
138 if (item) | 138 if (item) |
139 { | 139 { |
140 float rValue = this->PyValue_To_Float(item); | 140 float rValue = this->PyValue_To_Float(item); |
214 return 0; | 214 return 0; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 // convert the first element of iterable sequences | 218 // convert the first element of iterable sequences |
219 if (PySequence_Check(pyValue) and PySequence_Size(pyValue) > 0) | 219 if (PySequence_Check(pyValue) && PySequence_Size(pyValue) > 0) |
220 { | 220 { |
221 PyObject* item = PySequence_GetItem(pyValue,0); | 221 PyObject* item = PySequence_GetItem(pyValue,0); |
222 if (item) | 222 if (item) |
223 { | 223 { |
224 size_t rValue = this->PyValue_To_Size_t(item); | 224 size_t rValue = this->PyValue_To_Size_t(item); |