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.

classification
Title: Properly document setting m_size in PyModuleDef
Type: behavior Stage: resolved
Components: Documentation, Extension Modules Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eli.bendersky Nosy List: eli.bendersky, loewis, ncoghlan, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2013-08-06 13:20 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue18668.doc.1.patch eli.bendersky, 2013-08-06 14:06
issue18668.msize-fix.patch eli.bendersky, 2013-08-08 13:36 review
Messages (9)
msg194542 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-08-06 13:20
docs.python.org/dev/c-api/module.html Currently doesn't say much about m_size, except that setting it to -1 means "no memory needed".

m_size == -1 has a much more important use that is not documented: it signals the import machinery that the module should not be ever re-initialized. This has to be documented explicitly.
msg194548 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-08-06 14:06
Here's a documentation patch generated for 3.3
msg194550 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-06 14:16
Looks good to me, thanks.
msg194605 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-08-07 12:54
New changeset 698fd628b001 by Eli Bendersky in branch '3.3':
Issue #18668: Properly document setting m_size in PyModuleDef
http://hg.python.org/cpython/rev/698fd628b001

New changeset 9877c25d9556 by Eli Bendersky in branch 'default':
Closing #18668: Properly document setting m_size in PyModuleDef
http://hg.python.org/cpython/rev/9877c25d9556
msg194606 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-08-07 12:55
Thanks for the review!
msg194609 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2013-08-07 13:32
I thought setting m_size to zero was for "No per module state, but
reinitialization is fine"? Does that not work? (I haven't actually tried it)
msg194672 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-08-08 13:36
Nick, you're right - m_size=0 is a valid value. How about the attached patch?
msg194687 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2013-08-08 15:38
Looks good to me.
msg194791 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-08-10 12:58
New changeset f55ba27776d4 by Eli Bendersky in branch '3.3':
Issue #18668: Further clarify m_size setting for non-negative values
http://hg.python.org/cpython/rev/f55ba27776d4

New changeset d43435e82e21 by Eli Bendersky in branch 'default':
Issue #18668: Further clarify m_size setting for non-negative values
http://hg.python.org/cpython/rev/d43435e82e21
History
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62868
2013-08-10 12:58:45python-devsetmessages: + msg194791
2013-08-08 15:38:11ncoghlansetmessages: + msg194687
2013-08-08 13:36:45eli.benderskysetfiles: + issue18668.msize-fix.patch

messages: + msg194672
2013-08-07 13:32:30ncoghlansetmessages: + msg194609
2013-08-07 12:55:54eli.benderskysetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2013-08-07 12:55:25eli.benderskysetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg194606

stage: resolved -> needs patch
2013-08-07 12:54:57python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg194605

resolution: fixed
stage: needs patch -> resolved
2013-08-06 14:16:48pitrousetnosy: + pitrou
messages: + msg194550
2013-08-06 14:06:12eli.benderskysetfiles: + issue18668.doc.1.patch
keywords: + patch
messages: + msg194548
2013-08-06 13:20:58eli.benderskysetnosy: + loewis
2013-08-06 13:20:46eli.benderskycreate