This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xiang.zhang
Recipients ncoghlan, petr.viktorin, xiang.zhang
Date 2016-08-17.06:04:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471413877.95.0.607516843714.issue27782@psf.upfronthosting.co.za>
In-reply-to
Content
From doc [1], when create_module returns a non-module instance,  m_methods, m_traverse, m_clear, m_free must be NULL. But actually in the codes, only m_traverse, m_clear, m_free are checked and emitting consistent errors. If m_methods is NULL, it will fail in [2] and emit an inconsistent misleading argument error. And what's more confusing is, in [3], it says "regardless of type, the module's functions are initialized from m_methods, if any", which I think conflicts with the codes and doc.

[1] https://docs.python.org/3.6/c-api/module.html#c.Py_mod_create
[2] https://hg.python.org/cpython/file/tip/Objects/moduleobject.c#l300
[3] https://www.python.org/dev/peps/pep-0489/#post-creation-steps
History
Date User Action Args
2016-08-17 06:04:38xiang.zhangsetrecipients: + xiang.zhang, ncoghlan, petr.viktorin
2016-08-17 06:04:37xiang.zhangsetmessageid: <1471413877.95.0.607516843714.issue27782@psf.upfronthosting.co.za>
2016-08-17 06:04:37xiang.zhanglinkissue27782 messages
2016-08-17 06:04:37xiang.zhangcreate