bpo-35713: Rework Python initialization#11647
Merged
vstinner merged 1 commit intopython:masterfrom Jan 22, 2019
vstinner:rework_init
Merged
bpo-35713: Rework Python initialization#11647vstinner merged 1 commit intopython:masterfrom vstinner:rework_init
vstinner merged 1 commit intopython:masterfrom
vstinner:rework_init
Conversation
Member
Author
|
@scoder, @ericsnowcurrently: Do you think that it's ok to remove "PyXXX_Init()" from the C API? I don't see why anyone would call them explicitly? |
Member
Author
Ignore my questions. In fact, these functions are prefixed by "_Py": they are private, and we don't provide any stability warranty for the private API. |
* The PyByteArray_Init() and PyByteArray_Fini() functions have been
removed. They did nothing since Python 2.7.4 and Python 3.2.0, were
excluded from the limited API (stable ABI), and were not
documented.
* Move "_PyXXX_Init()" and "_PyXXX_Fini()" declarations from
Include/cpython/pylifecycle.h to
Include/internal/pycore_pylifecycle.h. Replace
"PyAPI_FUNC(TYPE)" with "extern TYPE".
* _PyExc_Init() now returns an error on failure rather than calling
Py_FatalError(). Move macros inside _PyExc_Init() and undefine them
when done. Rewrite macros to make them look more like statement:
add ";" when using them, add "do { ... } while (0)".
* _PyUnicode_Init() now returns a _PyInitError error rather than call
Py_FatalError().
* Move stdin check from _PySys_BeginInit() to init_sys_streams().
* _Py_ReadyTypes() now returns a _PyInitError error rather than
calling Py_FatalError().
Member
Author
|
I modified my PR to document properly the removal of PyByteArray_Init() and PyByteArray_Fini() functions: documented in the Porting section of What's New in Python 3.8 and in a NEWS entry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
did nothing since Python 2.7.4 and Python 3.2.0.
Py_FatalError(). Move macros inside _PyExc_Init() and undefine them
when done. Rewrite macros to make them look more like statement:
add ";" when using them, add "do { ... } while (0)".
Py_FatalError().
calling Py_FatalError().
Include/cpython/pylifecycle.h to
Include/internal/pycore_pylifecycle.h. Replace
"PyAPI_FUNC(TYPE)" with "extern TYPE".
https://bugs.python.org/issue35713