Author belopolsky
Recipients Robin.Schreiber, belopolsky, loewis
Date 2012-09-02.23:12:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346627533.87.0.669227234698.issue15849@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-09-02 23:12:13belopolskysetrecipients: + belopolsky, loewis, Robin.Schreiber
2012-09-02 23:12:13belopolskysetmessageid: <1346627533.87.0.669227234698.issue15849@psf.upfronthosting.co.za>
2012-09-02 23:12:13belopolskylinkissue15849 messages
2012-09-02 23:12:13belopolskycreate