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 pitrou
Recipients Arfrever, Robin.Schreiber, asvetlov, effbot, eli.bendersky, pitrou
Date 2013-08-08.14:00:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510306418.50638959.1375970404276.JavaMail.root@zimbra10-e2.priv.proxad.net>
In-reply-to <1375970194.83.0.231209418764.issue15651@psf.upfronthosting.co.za>
Content
> 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.
History
Date User Action Args
2013-08-08 14:00:10pitrousetrecipients: + pitrou, effbot, Arfrever, eli.bendersky, asvetlov, Robin.Schreiber
2013-08-08 14:00:10pitroulinkissue15651 messages
2013-08-08 14:00:10pitroucreate