Re: PEP 451 (ModuleSpec) round 3

Antoine Pitrou <[email protected]> Mon, 2 Sep 2013 15:15:20 +0200
Newsgroups gmane.comp.python.import
Message-ID <[email protected]>
Le Mon, 2 Sep 2013 23:09:18 +1000,
Nick Coghlan <[email protected]> a écrit :
> > Er... There may (or even will) be compatibility issues with that.
> > Such as pickling of top level functions, or the various
> > discrepancies of bound methods vs. plain functions. Or, of course,
> > all the changes in introspection results that might disrupt
> > existing code (think the various `inspect` functions).
> >
> > I think it would be much safer to have top level functions remain
> > plain functions, and take the module object as first argument as
> > they already do (the "PyObject *self"). And it would help extension
> > modules be more like normal Python modules.
> 
> Yeah, I made that suggestion when I was confused between which of
> PyModule_GetState and PyState_GetModule caused problems. Since it's
> only the latter, there's no need to muck about with exposing bound
> methods of objects with hidden state - we already have that by calling
> "PyModule_GetState" on the module parameter.

But even PyModule_GetState isn't necessary anymore, if module objects
can have custom C fields.

Regards

Antoine.


_______________________________________________
Import-SIG mailing list
[email protected]
http://mail.python.org/mailman/listinfo/import-sig