Jack Diederich wrote: > Changing the PySequence_SetItem to PyList_SetItem and dropping the > DECREF works for me too (PyList functions steal a reference). I also > tried setting the list to length 1, still no dice. The PySequence > version segs under 2.4 and 2.5. It segs even when the Int is changed > to a String. > > Yikes, I'll poke around some more.
Yikes indeed. Not the OP's problem, but a bug in the manual: example in the chapter that the OP was reading acts as though the 2nd arg to PyObject_SetItem is a C int (as it is for the List and Sequence varieties) -- it is in fact a (PyObject *), which explains the SystemError that I got. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list