Message272903
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 |
|
Date |
User |
Action |
Args |
2016-08-17 06:04:38 | xiang.zhang | set | recipients:
+ xiang.zhang, ncoghlan, petr.viktorin |
2016-08-17 06:04:37 | xiang.zhang | set | messageid: <1471413877.95.0.607516843714.issue27782@psf.upfronthosting.co.za> |
2016-08-17 06:04:37 | xiang.zhang | link | issue27782 messages |
2016-08-17 06:04:37 | xiang.zhang | create | |
|