Antoine Pitrou added the comment: > This code in the beginning in PyInit__elementtree: > > m = PyState_FindModule(&elementtreemodule); > if (m) { > Py_INCREF(m); > return m; > } > > Can you explain what use case it tries to cover? I couldn't find > similar code in other modules we have that implement PEP 3121 (_csv, > readline, io, etc.)
I don't know :-) I just re-used Robin's original patch. > >> I don't see a call to PyState_AddModule. What am I missing? > >It is called implicitly when an extension module is imported. > > Do you think this should be documented in the C API docs? The way > they read now, it seems that calling PyState_AddModule is needed > manually by extension writers. Well, how to deal with module state should probably be better documented. Not sure how, though. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15651> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com