On Tue, Apr 21, 2020 at 11:31 PM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
> To put it another way, the moment you start using subinterpreters,
> the set of extension modules you are able to use will shrink
> *enormously*.

Very true but we have to start somewhere.

> And if I understand correctly, you won't get any nice "This
> module does not support subinterpreters" exception if you
> import an incompatible module -- just an obscure crash,
> probably of the core-dumping variety.

As Petr noted, we can use PEP 489 (Multi-phase Extension Module
Initialization) support as an indicator and raise ImportError for any
other extension modules (when in a subinterpreter).  That seems like a
reasonable way to avoid the hard-to-debug failures that would result
otherwise.

The only question I have is if it makes sense to offer a way to
disable such a check (e.g. a flag when creating a subinterpreter).  I
think so, since then extension authors could more easily test their
extension under subinterpreters without having to release a separate
build that has PEP 489 support.

-eric
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/IB5IAQUMPFV3W2V3EBBKWRJWROZ42OVD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to