| 337 | class DictValueIterator : public ValueIterator { |
| 338 | public: |
| 339 | explicit DictValueIterator(PyObject* dict) |
| 340 | : dict_(dict), keys_(PyDict_Keys(dict)) { |
| 341 | if (PyList_Sort(keys_.get()) == -1) { |
| 342 | invalidate(); |
| 343 | } else { |
| 344 | iter_.reset(PyObject_GetIter(keys_.get())); |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | Safe_PyObjectPtr next() override { |
| 349 | Safe_PyObjectPtr result; |