Writing an Extension: 2 questions (so far)

Tyler W. Wilson tyler.w.wilson at gte.net
Thu Jan 3 16:39:35 CET 2002

1) I have the basic skeleton working for an extension. Now I want to know on
the C side when the user does a del <module>. What entry in the PhMethodDef
structure should I add, or is there a global function that is called?

I noticed that after I do import <module> then a del <module>, my DLL is
still in memory. Is this expected. I would have expected it to
reference-counted like everything else, and cleaned up when no longer used.

2) I am writing one function which takes a string, either multibyte or
Unicode. I want to call PyArg_ParseTuple once, and have it convert the
string passed into my desired output (n this case, Unicode). Some thing
like: ParseTuple(args, "u", &ustr); But it appears that the interpreter will
not automatically do this for, or is there a way?

Thank you,
Tyler Wilson

More information about the Python-list mailing list