summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35134: Migrate frameobject.h contents to cpython/frameobject.h (GH-18052)Nick Coghlan2020-01-202-74/+95
|
* bpo-39372: Clean header files of declared interfaces with no implementations ↵Pablo Galindo2020-01-1811-54/+0
| | | | | | | | (GH-18037) The public API symbols being removed are: _PyBytes_InsertThousandsGroupingLocale, _PyBytes_InsertThousandsGrouping, _Py_InitializeFromArgs, _Py_InitializeFromWideArgs, _PyFloat_Repr, _PyFloat_Digits, _PyFloat_DigitsInit, PyFrame_ExtendStack, _PyAIterWrapper_Type, PyNullImporter_Type, PyCmpWrapper_Type, PySortWrapper_Type, PyNoArgsFunction.
* bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)Niklas Fiekas2020-01-161-0/+8
| | | Add _Py_bit_length() to unify duplicate bits_in_digit() and bit_length().
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-5/+3
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* bpo-38644: Pass tstate to _Py_FinishPendingCalls() (GH-17990)Victor Stinner2020-01-131-1/+1
| | | | _Py_FinishPendingCalls() now expects a tstate argument, instead of a runtime argument.
* bpo-39164: Add private _PyErr_GetExcInfo() function (GH-17752)Julien Danjou2020-01-131-0/+1
| | | | | | This adds a new function named _PyErr_GetExcInfo() that is a variation of the original PyErr_GetExcInfo() taking a PyThreadState as its first argument. That function allows to retrieve the exceptions information of any Python thread -- not only the current one.
* Py_DECREF: only pass filename if Py_REF_DEBUG is defined (GH-17870)Victor Stinner2020-01-081-5/+10
| | | | | | | Filename and line numbers are not needed when Py_REF_DEBUG are not defined. The static inline _Py_DECREF() function was introduced by commit 2aaf0c12041bcaadd7f2cc5a54450eefd7a6ff12.
* Move comment about permanent generation to gcmodule.c (GH-17718)Pablo Galindo2019-12-271-36/+0
| | | | | | The comment about the collection rules for the permanent generation was incorrectly referenced by a comment in gcmodule.c (the comment has been moved long ago into a header file). Moving the comment into the relevant code helps with readability and avoids broken references.
* Post 3.9.0a2Łukasz Langa2019-12-191-1/+1
|
* Python 3.9.0a2v3.9.0a2Łukasz Langa2019-12-181-2/+2
|
* bpo-38858: Small integer per interpreter (GH-17315)Victor Stinner2019-12-172-2/+14
| | | | | | | | | | | | Each Python subinterpreter now has its own "small integer singletons": numbers in [-5; 257] range. It is no longer possible to change the number of small integers at build time by overriding NSMALLNEGINTS and NSMALLPOSINTS macros: macros should now be modified manually in pycore_pystate.h header file. For now, continue to share _PyLong_Zero and _PyLong_One singletons between all subinterpreters.
* bpo-38858: new_interpreter() reuses _PySys_Create() (GH-17481)Victor Stinner2019-12-061-1/+0
| | | | | | | new_interpreter() now calls _PySys_Create() to create a new sys module isolated from the main interpreter. It now calls _PySys_InitCore() and _PyImport_FixupBuiltin(). init_interp_main() now calls _PySys_InitMain().
* bpo-27961: Replace PY_LLONG_MAX, PY_LLONG_MIN and PY_ULLONG_MAX with ↵Sergey Fedoseev2019-12-051-4/+4
| | | | | standard macros (GH-15385) Use standard constants LLONG_MIN, LLONG_MAX and ULLONG_MAX.
* bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)Victor Stinner2019-11-231-11/+0
| | | | Remove PyUnicode_ClearFreeList() function: the Unicode free list has been removed in Python 3.3.
* bpo-38858: new_interpreter() reuses pycore_init_builtins() (GH-17351)Victor Stinner2019-11-221-1/+0
| | | | | | | | | new_interpreter() now calls _PyBuiltin_Init() to create the builtins module and calls _PyImport_FixupBuiltin(), rather than using _PyImport_FindBuiltin(tstate, "builtins"). pycore_init_builtins() is now responsible to initialize intepr->builtins_copy: inline _PyImport_Init() and remove this function.
* bpo-38858: _PyImport_FixupExtensionObject() handles subinterpreters (GH-17350)Victor Stinner2019-11-222-1/+6
| | | | | If _PyImport_FixupExtensionObject() is called from a subinterpreter, leave extensions unchanged and don't copy the module dictionary into def->m_base.m_copy.
* bpo-38858: Call _PyUnicode_Fini() in Py_EndInterpreter() (GH-17330)Victor Stinner2019-11-221-1/+1
| | | Py_EndInterpreter() now clears the filesystem codec.
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-6/+2
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* bpo-38858: Add _Py_IsMainInterpreter(tstate) (GH-17293)Victor Stinner2019-11-201-0/+2
|
* bpo-37340: Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() ↵Victor Stinner2019-11-203-6/+0
| | | | | | | | (GH-17284) Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() functions: the free lists of bound method objects have been removed. Remove also _PyMethod_Fini() and _PyCFunction_Fini() functions.
* bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287)Victor Stinner2019-11-203-6/+5
| | | | | * Rename _PyGC_InitializeRuntime() to _PyGC_InitState() * finalize_interp_clear() now also calls _PyGC_Fini() in subinterpreters (clear the GC state).
* bpo-38835: Exclude PyFPE macros from the stable API (GH-17228)Victor Stinner2019-11-201-0/+3
| | | | Exclude PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros of pyfpe.h from Py_LIMITED_API (stable API).
* bpo-36854: gcmodule.c gets its state from tstate (GH-17285)Victor Stinner2019-11-202-5/+7
| | | | | | | | | * Add GCState type for readability * gcmodule.c now gets its gcstate from tstate * _PyGC_DumpShutdownStats() now expects tstate rather than runtime * Rename "state" to "gcstate" for readability: to avoid confusion between "state" and "tstate" for example. * collect() now only expects tstate: it gets gcstate from tstate. * Pass tstate to _PyErr_xxx() functions
* bpo-38858: Factorize Py_EndInterpreter() code (GH-17273)Victor Stinner2019-11-201-2/+2
| | | | | | * Factorize code in common between Py_FinalizeEx() and Py_EndInterpreter(). * Py_EndInterpreter() now also calls _PyWarnings_Fini(). * Call _PyExc_Fini() and _PyGC_Fini() later in the finalization.
* bpo-36710: Add PyInterpreterState.runtime field (GH-17270)Victor Stinner2019-11-202-9/+8
| | | | | | | | | | | Add PyInterpreterState.runtime field: reference to the _PyRuntime global variable. This field exists to not have to pass runtime in addition to tstate to a function. Get runtime from tstate: tstate->interp->runtime. Remove "_PyRuntimeState *runtime" parameter from functions already taking a "PyThreadState *tstate" parameter. _PyGC_Init() first parameter becomes "PyThreadState *tstate".
* Post 3.9.0a1Łukasz Langa2019-11-201-1/+1
|
* Merge tag 'v3.9.0a1'Łukasz Langa2019-11-201-2/+2
|\
| * Python 3.9.0a1v3.9.0a1Łukasz Langa2019-11-191-2/+2
| |
* | bpo-38631: Avoid Py_FatalError() in handle_legacy_finalizers() (GH-17266)Victor Stinner2019-11-202-1/+2
|/ | | | | * Rename _PyGC_Initialize() to _PyGC_InitializeRuntime() * Add _PyGC_Init(): initialize _PyRuntime.gc.garbage list * Call _PyGC_Init() before _PyTypes_Init()
* bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)Serhiy Storchaka2019-11-161-1/+1
| | | | Make it a constant and referring to a constant string.
* bpo-38644: Cleanup ceval.h (GH-17185)Victor Stinner2019-11-162-36/+25
| | | | Move CPython API (Py_LIMITED_API macro not defined) from ceval.h to cpython/ceval.h
* bpo-38644: Add _PyEval_EvalCode() (GH-17183)Victor Stinner2019-11-161-0/+10
| | | _PyFunction_Vectorcall() now pass tstate to function calls.
* bpo-38644: Add _PyObject_Call() (GH-17089)Victor Stinner2019-11-142-10/+46
| | | | | | | | | | * Add pycore_call.h internal header file. * Add _PyObject_Call(): PyObject_Call() with tstate * Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate * Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict() with tstate * _PyObject_Call_Prepend() now takes tstate * Replace _PyObject_FastCall() calls with _PyObject_VectorcallTstate() calls
* bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)Victor Stinner2019-11-141-0/+9
| | | | Add _PyEval_EvalFrame() static inline function to get eval_frame from tstate->interp.
* bpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)Victor Stinner2019-11-081-4/+14
| | | | | * Add _PyObject_VectorcallTstate() function: similar to _PyObject_Vectorcall(), but with tstate parameter * Add tstate parameter to _PyObject_MakeTpCall()
* bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)Victor Stinner2019-11-071-1/+2
| | | | | | | | | | | bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate == NULL" test. Py_FatalError() no longer calls PyErr_Occurred() if called without holding the GIL. So PyErr_Occurred() no longer has to support tstate==NULL case. _Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid explicit "!= NULL" test.
* bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328)Vinay Sajip2019-11-071-0/+9
|
* bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)Jeroen Demeyer2019-11-051-0/+1
| | | | | | | | | | | | Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code. CC @vstinner @encukou https://bugs.python.org/issue37645 Automerge-Triggered-By: @encukou
* bpo-38644: Pass tstate to _Py_CheckFunctionResult() (GH-17050)Victor Stinner2019-11-052-4/+14
| | | | | * Add tstate parameter to _Py_CheckFunctionResult() * Add _PyErr_FormatFromCauseTstate() * Replace PyErr_XXX(...) with _PyErr_XXX(state, ...)
* bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)Victor Stinner2019-11-041-14/+31
| | | | | | | | | | | | | * Add _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() which require a tstate argument. * Pass tstate to _Py_MakeRecCheck() and _Py_CheckRecursiveCall(). * Convert Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros to static inline functions. _PyThreadState_GET() is the most efficient way to get the tstate, and so using it with _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() should be a little bit more efficient than using Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() which use the "slower" PyThreadState_GET().
* bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)Victor Stinner2019-11-042-35/+58
| | | | | | | | | | Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as regular functions for the limited API. Previously, there were defined as macros, but these macros didn't work with the limited API which cannot access PyThreadState.recursion_depth field. Remove _Py_CheckRecursionLimit from the stable ABI. Add Include/cpython/ceval.h header file.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-3/+3
| | | | Replace all *NULL* with ``NULL``.
* bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)Hai Shi2019-10-211-5/+4
|
* bpo-11410: Standardize and use symbol visibility attributes across POSIX and ↵Vinay Sajip2019-10-152-11/+43
| | | | Windows. (GH-16347)
* bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)Victor Stinner2019-10-101-1/+1
| | | | | bpo-38392, bpo-38426: Fix a compiler warning in gcmodule.c. Fix also a typo in PYMEM_DEADBYTE macro comment.
* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)Victor Stinner2019-10-071-0/+15
| | | | Fix _PyBytesWriter API when Python is built in release mode with assertions.
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)Victor Stinner2019-10-074-15/+11
| | | | | | | | | | | | | | | | | | | | | bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC. Modify the following functions to also work in release mode: * _PyDict_CheckConsistency() * _PyObject_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() Other changes: * _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL (equals to 0). * _PyBytesWriter_CheckConsistency() now returns 1 and is only used with assert(). * Reorder _PyObject_Dump() to write safe fields first, and only attempt to render repr() at the end.
* bpo-38353: getpath.c: allocates strings on the heap (GH-16585)Victor Stinner2019-10-041-3/+2
| | | | | | | | | | | * _Py_FindEnvConfigValue() now returns a string allocated by PyMem_RawMalloc(). * calculate_init() now decodes VPATH macro. * Add calculate_open_pyenv() function. * Add substring() and joinpath2() functions. * Fix add_exe_suffix() And a few cleanup changes.
* bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal ↵Joannah Nanjekye2019-10-041-0/+1
| | | | | (GH-16558) Revert the removal of PyThreadState_DeleteCurrent() with documentation.
* bpo-38353: Fix compiler warning in internal headers (GH-16573)Victor Stinner2019-10-043-16/+16
| | | | Replace "_PyRuntimeState" with "struct pyruntimestate" to avoid a warning on typedef re-definition.