[issue32124] Document functions safe to be called before Py_Initialize()

2017-12-15 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4536 ___ Python tracker ___ ___

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread Nick Coghlan
Nick Coghlan added the comment: Key point to note regarding PEP 432: at least personally, I'm not actually aiming to deprecate the legacy embedding API. Instead, I'm just aiming to eventually stop *adding* to it, with new config structs replacing the current ad hoc mix of

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread Eric Snow
Eric Snow added the comment: I've left a review (writing it as you merged the PR). My main concern is that we not promise more than we must. Every pre-init function or variable we promise to embedders represents global state that is hard to get rid of. It also

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: > Then document this explicitly like for other functions that *should* be > called before Py_Initialize() if called at all. I agree that it would be even better to document if a function must not be called after Py_Initialize().

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset 84c4b1938fade2b425ac906730beabd413de094d by Victor Stinner in branch 'master': bpo-32124: Document C functions safe before init (#4540) https://github.com/python/cpython/commit/84c4b1938fade2b425ac906730beabd413de094d

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I'm quite sure that calling PyMem_SetAllocator() or > PyObject_SetArenaAllocator() after Py_Initialize() will quickly crash. Then document this explicitly like for other functions that *should* be called before Py_Initialize()

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: > Should PyMem_SetAllocator() and PyObject_SetArenaAllocator() be called before > Py_Initialize(), or they can be called after it? I'm quite sure that calling PyMem_SetAllocator() or PyObject_SetArenaAllocator() after

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should PyMem_SetAllocator() and PyObject_SetArenaAllocator() be called before Py_Initialize(), or they can be called after it? If PyMem_Malloc() and PyObject_Malloc() are not needed for pre-initialization, should we support

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: > Are you sure about PyMem_Malloc() and PyObject_Malloc()? Technically, the pymalloc memory allocator is initialized statically by the compiler, from the first instruction of the process. But maybe we should not suggest users to

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are you sure about PyMem_Malloc() and PyObject_Malloc()? What functions require them? I thought only PyMem_RawMalloc() can be called before Py_Initialize(). I think that for all functions that *can* or *should* be called before

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +4474 stage: -> patch review ___ Python tracker ___

[issue32124] Document functions safe to be called before Py_Initialize()

2017-11-24 Thread STINNER Victor
New submission from STINNER Victor : Follow-up of bpo-32086, bpo-32096 and "[Python-Dev] Python initialization and embedded Python" thread: https://mail.python.org/pipermail/python-dev/2017-November/150605.html I propose to explicitly list functions that can be