PyObject *dkeys =PyDict_Keys(dict);// = dict.keys()if(!dkeys)return0;// no valid dictionaryj = PySequence_Size(dkeys);// len(dict.keys())PyObject *validkeys = PyList_New(0);// make list of valid keysva_list ap;// def var arg listva_start(ap, vkeys);// start of args...
{'one':'first','two':'second','three':'third'}>>> it =iter(adict)>>>it<dict_keyiterator object at 0x010A8F60> >>>next(it)'one'>>> keys =adict.keys()>>>keys dict_keys(['one','two','three'])>>> items =adict.items()>>>items dict_items([('one','first'), ('two...
The dump_stack() function, used when tracing micro-op execution, crashes if a PyDictKeysObject* pointer is on the stack. Despite the name, PyDictKeysObject is not a PyObject. Introduced in f978fb4 I think the best fix would be arrange the fields (at least in the debug build) of Py...