MapType CyPy_Element::dictAsElement(const Py::Dict& dict) { MapType map; for (auto key : dict.keys()) { map.emplace(key.str(), asElement(dict.getItem(key))); } return map; }
void copy(Py::Dict sourceRange, OutputIt targetIt) { string key; string value; for (auto keyPy : sourceRange.keys()) { key = Py::String(keyPy); value = Py::String(sourceRange[keyPy]); *targetIt = {key, value}; ++targetIt; } }