212
220
while PyDict_Next(parent_map, &pos, &temp_key, &temp_parent_keys):
214
222
parent_keys = <object>temp_parent_keys
216
229
# We know how many parents, so we could pre allocate an exact sized
219
231
parent_nodes = PyTuple_New(num_parent_keys)
220
232
# We use iter here, because parent_keys maybe be a list or tuple
221
233
for pos2 from 0 <= pos2 < num_parent_keys:
224
240
# PyTuple_SET_ITEM will steal a reference, so INCREF first
226
242
PyTuple_SET_ITEM(parent_nodes, pos2, parent_node)