New submission from Xiang Zhang:

>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

----------
components: Interpreter Core
messages: 272903
nosy: encukou, ncoghlan, xiang.zhang
priority: normal
severity: normal
status: open
title: Multi-phase extension module initialization, inconsistent exceptions and 
conflicts between code and PEP
type: behavior
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to