STINNER Victor <victor.stin...@gmail.com> added the comment:

>  We *don't* currently have anything like that for environment variables, not 
> even the ones which are "read once at startup, then never read them again".

I changed Py_Main() in bpo-32030. Now multiple environment variables are read 
once at startup and put into _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Modules/main.c#L1365-L1413

I added new fields to _PyCoreConfig:

https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Include/pystate.h#L27-L39

I suggest to continue to add more fields to _PyCoreConfig to move all code to 
configure Python before Py_Initialize(), and later to let users embedding 
Python to configure Python as they want, without losing features. For example, 
to enable the new "development mode" (-X dev), now you "just" have to set 
_PyCoreConfig.dev_mode to 1.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32096>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to