Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Re: redesigning the extension module initialisation protocol

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


stefan_ml at behnel

Aug 11, 2013, 10:51 AM

Post #1 of 2 (14 views)
Permalink
Re: redesigning the extension module initialisation protocol

Eli Bendersky, 11.08.2013 19:43:
> Out of curiosity - can we list actual use cases for this new design? The
> previous thread, admittedly, deals with an isoteric corner-cases that comes
> up in overly-clever tests. If we plan to serious consider these changes -
> and this appears to be worth a PEP - we need a list of actual advantages
> over the current approach. It's not that a more conceptually pure design is
> an insufficient reason, IMHO, but it would be interesting to hear about
> other implications.

http://mail.python.org/pipermail/python-dev/2012-November/122599.html

http://bugs.python.org/issue13429

http://bugs.python.org/issue16392

Yes, it definitely needs a PEP.

Stefan


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stefan_ml at behnel

Aug 11, 2013, 9:51 PM

Post #2 of 2 (11 views)
Permalink
Re: redesigning the extension module initialisation protocol [In reply to]

Nick Coghlan, 12.08.2013 00:41:
> On 11 Aug 2013 09:55, "Stefan Behnel" wrote:
>>>>> this already suggests a simple module initialisation interface.
>>>>> The
>>>>> extension module would expose a function that returns a module type,
>>>>> and
>>>>> the loader/importer would then simply instantiate that. Nothing else
>>>>> is needed.
>>>> Actually, strike the word "module type" and replace it with "type".
>> [...]
>> Next, we need to define a signature for the type's __init__() method.
>
> We need the "ModuleSpec" object to pass here, which is what we're currently
> working on in import-sig.

Ok but that's just the very final step. All the rest is C-API specific.

And for clarification: you want to let the importer create the ModuleSpec
object and the pass it into the module's __init__ method?

I guess it could also be passed into the type creation function then,
right? Since it wouldn't harm to do that, I think it's a good idea to
provide as much information to the extension module as possible, as early
as we can, and that's the first time we talk to the shared library.

I've started writing up a pre-PEP that describes this protocol. I think it
makes sense to keep it separate from the ModuleSpec PEP as the latter can
easily be accepted without changing anything at the C-API level, but it
shouldn't happen the other way round.

Stefan


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.