lgx schrieb: > Does PyDict_SetItemString(pDict,"key",PyString_FromString("value")) > cause memory leak?
You shouldn't use that at all. If you look at the sources, what SetItemString does is: create a Python string from the char* and call PyDict_SetItem() to put the new string in. So it is actually much more efficient to use PyDict_SetItem() directly in your case. If you want to temporarily create a char* from a string and you know that the char content won't be modified, use the PyString_FROM_STRING macro, which just returns the internal pointer. Stefan -- http://mail.python.org/mailman/listinfo/python-list