summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-032-5/+5
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* GH-98831: Support cache effects in super- and macro instructions (#99601)Guido van Rossum2022-12-031-2/+2
|
* gh-99741: Clean Up the _xxsubinterpreters Module (gh-99940)Eric Snow2022-12-021-9/+11
| | | | | This cleanup up resolves a few subtle bugs and makes the implementation for multi-phase init much cleaner. https://github.com/python/cpython/issues/99741
* gh-99955: standardize return values of functions in assembler and optimizer. ↵Irit Katriel2022-12-021-42/+54
| | | | (#99956)
* gh-99741: Fix the Cross-Interpreter Data API (gh-99939)Eric Snow2022-12-021-23/+84
| | | | | There were some minor issues that showed up while I was working on porting _xxsubinterpreters to multi-phase init. This fixes them. https://github.com/python/cpython/issues/99741
* GH-91054: Add code object watchers API (GH-99859)Itamar Ostricher2022-12-021-0/+5
| | | | | | * Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
* gh-89189: More compact range iterator (GH-27986)Serhiy Storchaka2022-11-302-6/+8
|
* GH-99877)Irit Katriel2022-11-301-23/+41
|
* gh-87092: move all localsplus preparation into separate function called from ↵Irit Katriel2022-11-301-30/+41
| | | | assembler stage (GH-99869)
* GH-81057: remove static state from suggestions.c (#99411)Kumar Aditya2022-11-301-8/+19
|
* gh-64490: Fix bugs in argument clinic varargs processing (#32092)colorfulappl2022-11-241-1/+19
|
* gh-99708: fix bug where compiler crashes on if expression with an empty body ↵Irit Katriel2022-11-241-3/+17
| | | | block (GH-99732)
* gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)Victor Stinner2022-11-233-18/+9
| | | Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
* GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)Guido van Rossum2022-11-232-62/+73
| | | | | | | | | | | | | | Newly supported interpreter definition syntax: - `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }` - `macro(NAME) = OP1 + OP2;` Also some other random improvements: - Convert `WITH_EXCEPT_START` to use stack effects - Fix lexer to balk at unrecognized characters, e.g. `@` - Fix moved output names; support object pointers in cache - Introduce `error()` method to print errors - Introduce read_uint16(p) as equivalent to `*p` Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-88226: Emit TARGET labels in Python/ceval.c when debugging, even if ↵Skip Montanaro2022-11-221-4/+21
| | | | | | | computed gotos aren't enabled (GH-98265) Keep target labels when debugging, but don't warn about lack of use. Co-authored-by: Eryk Sun <eryksun@gmail.com>
* gh-99537: Use Py_SETREF() function in C code (#99657)Victor Stinner2022-11-228-25/+11
| | | | | | | | | | | | | | | Fix potential race condition in code patterns: * Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" * Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);" * Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);" Other changes: * Replace "old = var; var = new; Py_DECREF(var)" with "Py_SETREF(var, new);" * Replace "old = var; var = new; Py_XDECREF(var)" with "Py_XSETREF(var, new);" * And remove the "old" variable.
* gh-91053: Add an optional callback that is invoked whenever a function is ↵mpage2022-11-221-0/+5
| | | | modified (#98175)
* gh-99578: Fix refleak in _imp.create_builtin() (#99642)Victor Stinner2022-11-211-1/+2
| | | | Fix a reference bug in _imp.create_builtin() after the creation of the first sub-interpreter for modules "builtins" and "sys".
* gh-99337: Fix compile errors with gcc 12 on macOS (#99470)Ronald Oussoren2022-11-211-3/+4
| | | | | | | | Fix a number of compile errors with GCC-12 on macOS: 1. In pylifecycle.c the compile rejects _Pragma within a declaration 2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS 3. _ctypes assumed that __builtin_available is always present on macOS
* GH-98831: Refactor and fix cases generator (#99526)Guido van Rossum2022-11-182-67/+61
| | | | Also complete cache effects for BINARY_SUBSCR family.
* GH-99298: Clean up attribute specializations (GH-99398)Brandt Bucher2022-11-173-54/+33
|
* GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)Brandt Bucher2022-11-174-115/+72
|
* Add a macro for "inlining" new frames (GH-99490)Brandt Bucher2022-11-173-86/+28
|
* gh-99377: Revert audit events for thread state creation and free, because ↵Steve Dower2022-11-171-18/+1
| | | | the GIL is not properly held at these times (GH-99543)
* gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)Eric Snow2022-11-161-1/+1
| | | | | We also move the global func version. https://github.com/python/cpython/issues/81057
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)Victor Stinner2022-11-1610-39/+23
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-99377: Add audit events for thread creation and clear (GH-99378)Steve Dower2022-11-161-6/+25
|
* gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)Eric Snow2022-11-162-78/+46
| | | | | This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState). https://github.com/python/cpython/issues/81057
* gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)Eric Snow2022-11-168-23/+20
| | | https://github.com/python/cpython/issues/81057
* GH-98831: Implement basic cache effects (#99313)Guido van Rossum2022-11-162-56/+48
|
* gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code ↵Hood Chatham2022-11-152-6/+6
| | | | paths (#99461)
* gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)Eric Snow2022-11-154-30/+35
| | | | | This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
* gh-99300: Use Py_NewRef() in Python/Python-ast.c (#99499)Victor Stinner2022-11-151-140/+73
| | | | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Python/Python-ast.c. Update Parser/asdl_c.py to regenerate code.
* GH-99205: remove `_static` field from `PyThreadState` and ↵Kumar Aditya2022-11-151-10/+6
| | | | `PyInterpreterState` (GH-99385)
* gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)Eric Snow2022-11-141-6/+9
| | | https://github.com/python/cpython/issues/81057
* gh-87604: Avoid publishing list of active per-interpreter audit hooks via ↵Steve Dower2022-11-141-0/+2
| | | | the gc module (GH-99373)
* gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)Eric Snow2022-11-142-1/+5
| | | | | This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
* gh-87092: expose the compiler's codegen to python for unit tests (GH-99111)Irit Katriel2022-11-141-53/+120
|
* gh-99103: Normalize specialized traceback anchors against the current line ↵Batuhan Taskaya2022-11-121-2/+7
| | | | | (GH-99145) Automerge-Triggered-By: GH:isidentical
* gh-98762: Fix locations of match sub-patterns (GH-98775)Irit Katriel2022-11-121-129/+116
|
* gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)Eric Snow2022-11-123-6/+68
| | | | | We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point. https://github.com/python/cpython/issues/81057
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-112-3/+6
| | | | | The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057
* gh-81057: Add PyInterpreterState.static_objects (gh-99397)Eric Snow2022-11-111-1/+1
| | | | | As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.) https://github.com/python/cpython/issues/81057
* gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)Eric Snow2022-11-111-28/+50
| | | | | We also move the closely related max_module_number and add comments documenting the group of struct members. https://github.com/python/cpython/issues/81057
* gh-99254: remove all unused consts from code objects (GH-99255)Irit Katriel2022-11-111-19/+92
|
* GH-98831: Remove all remaining DISPATCH() calls from bytecodes.c (#99271)Guido van Rossum2022-11-102-169/+175
| | | | | Also mark those opcodes that have no stack effect as such. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* GH-99298: Don't perform jumps before error handling (GH-99299)Brandt Bucher2022-11-102-30/+38
|
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-109-219/+217
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* GH-99257: Check the owner's type when specializing slots (GH-99258)Brandt Bucher2022-11-101-0/+8
|
* gh-99300: Use Py_NewRef() in Python/ceval.c (#99318)Victor Stinner2022-11-103-128/+68
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Python/ceval.c and related files.