[Python-Dev] RELEASED Python 2.3.3 (release candidate 1) - custom Py_Initialize() (original) (raw)

Thomas Heller theller at python.net
Wed Dec 17 06:32:32 EST 2003


"Wiktor Sadowski" <art at wiktorsadowski.com> writes:

Adding a few lines (below) to Python would enable custom PyInitialize() and would allow to setup on time different than existing (import.c-zipimport.c) import mechanisms and changing some other Python-initialization internals without messing with Python core.

It should make life easier for embedders and help writing specialized Python executables (like Zope or Quixote). (We have such specialized executable to run packed Python programs remotely,kind of Java Web Start). From what I know Python installers (py2exe,Gordon McMillan's installer) could benefit from such addition as well. All these functions simply expose some modules globals. They don't change anything in Python core. Best regards, Wiktor Sadowski

/pythonrun.c/ void InternalPySetInitialized(int){initialized=i;} void InternalPyUnicodeInit(void){PyUnicodeInit();} void InternalPyUnicodeFini(void){PyUnicodeFini();} void InternalPyGILStateInit(PyInterpreterState *s, PyThreadState *ts){PyGILStateInit(s,ts);} void InternalPyGILStateFini(void){PyGILStateFini();} long InternalPyGCCollect(void){return PyGCCollect();} /pythonrun.h/ PyAPIFUNC(void) InternalPySetInitialized(int i); PyAPIFUNC(void) InternalPyUnicodeInit(void); PyAPIFUNC(void) InternalPyUnicodeFini(void); PyAPIFUNC(void) InternalPyGILStateInit(PyInterpreterState *, PyThreadState *); PyAPIFUNC(void) InternalPyGILStateFini(void); PyAPIFUNC(long) InternalPyGCCollect(void);

I would rather like a function like Py_InitializeEx(struct _init*), where struct _init would have components like PYTHONPATH, optimize, and so on.

Thomas



More information about the Python-Dev mailing list