Alexander Belopolsky added the comment: xxmodule.c is used as an example in PEP 3121 itself. To the extent the recipe in the PEP is complete, the changes to actual xxmodule.c should follow the text. For example, the text in PEP recommends to leave m_free member of PyModuleDef 0:
static struct PyModuleDef xxmodule = { {}, /* m_base */ sizeof(struct xxstate), &xx_methods, 0, /* m_reload */ xx_traverse, xx_clear, 0, /* m_free - not needed, since all is done in m_clear */ } In your patch, member names are not shown in the initializer. The PEP text also omits them when it is obvious from the value. (xx_clear initializes m_clear.) I think all lines in the initializer should include the member name in comments. The reason is that people will use xxmodule.c as a template for their code and may want to replace xx_clear with something that is not as suggestive. You should add some tests demonstrating that module load/unload cycles do not introduce reference leaks. ---------- nosy: +loewis _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15849> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com