| 1344 | } |
| 1345 | |
| 1346 | inline size_t getArrayNdim(PyObject* obj) |
| 1347 | { |
| 1348 | UniqueObj attr{ PyObject_GetAttrString(obj, "ndim") }; |
| 1349 | if (!attr) throw ExcPropagation{}; |
| 1350 | size_t v = (size_t)PyLong_AsSize_t(attr.get()); |
| 1351 | if (v == (size_t)-1 && PyErr_Occurred()) throw ExcPropagation{}; |
| 1352 | return v; |
| 1353 | } |
| 1354 | |
| 1355 | template<typename _Ty, typename _Alloc> |
| 1356 | struct ValueBuilder<std::vector<_Ty, _Alloc>, |