On 17. 12. 21 4:02, Jim J. Jewett wrote:
Petr Viktorin wrote:
In Python 3.11, Python still implements around 100 types as "static
types" which are not compatible with subinterpreters,
...
seems like changing it may break the C API *and* the stable ABI

If sub-interpreters each need their own copy of even immutable built-in types, 
then what advantage do they have over separate processes?

They need copies of all *Python* objects. A non-Python library may allow
several Python wrappers/proxies for a single internal object,
effectively sharing that object between subinterpreters.
(Which is a problem for removing the GIL -- currently all operations
done by such wrappers are protected by the GIL.)

OK, so what is the advantage of having multiple interpreters?

The only advantage I can see is that if you're embedding what are essentially several 
distinct python processes, you can still keep them all inside the single process used by 
the embedding program.  But seems pretty far along the "they're already compiling 
anyhow; so the ABI isn't crucial" path.

You should be able to use Python as an implementation detail of a library.For example, an application should be able to use several such libraries, without their Python runtimes influencing each other.

See PEP 630 for some more details: https://www.python.org/dev/peps/pep-0630/#motivation
_______________________________________________
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/CQ36ECT4PFXQMPDIIDHCG2YFYFCAXDPZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to