summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-119180: No longer set `__annotations__` in `__main__` (#124634)Jelle Zijlstra2024-09-271-7/+1
|
* gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)Neil Schemenauer2024-09-271-3/+26
| | | | | Fix a bug that can cause a crash when sub-interpreters use "basic" single-phase extension modules. Shared objects could refer to PyGC_Head nodes that had been freed as part of interpreter shutdown.
* GH-123516: Improve JIT memory consumption by invalidating cold executors ↵Savannah Ostrowski2024-09-276-0/+70
| | | | | (GH-124443) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-119333: get interp from tstate for PyContext watchers(#124444)Jason Fried2024-09-261-4/+4
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-117376: Fix off-by-ones in conversion functions (GH-124301)Ken Jin2024-09-253-6/+6
| | | Fix off-by-ones in conversion function
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-253-6/+81
| | | | of a boolean expression (#124394)
* gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)Sam Gross2024-09-249-111/+87
| | | | | | Use a `_PyStackRef` and defer the reference to `f_funcobj` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)Serhiy Storchaka2024-09-241-35/+56
| | | | | | | | * Detect source file encoding. * Use the "replace" error handler even for UTF-8 (default) encoding. * Remove the BOM. * Fix detection of too long lines if they contain NUL. * Return the head rather than the tail for truncated long lines.
* gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)Jason Fried2024-09-242-0/+81
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-124284: Add stats for refcount operations on immortal objects (GH-124288)Mark Shannon2024-09-232-4/+11
|
* gh-111513: Improve datetime.fromtimestamp's error message (#124249)AN Long2024-09-201-0/+4
|
* gh-123880: Allow recursive import of single-phase-init modules (GH-123950)Petr Viktorin2024-09-201-5/+13
| | | | Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
* gh-124160: Pass main_tstate to update_global_state_for_extension() (#124164)luk13372024-09-191-1/+1
|
* gh-116022: Improve `repr()` of AST nodes (#117046)Tomas R2024-09-181-0/+222
| | | | | | Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-123969: refactor _PyErr_RaiseSyntaxError and _PyErr_EmitSyntaxWarning out ↵Irit Katriel2024-09-162-30/+53
| | | | of compiler (#123972)
* gh-124058: remove _PyCompile_IsNestedScope, roll it into ↵Irit Katriel2024-09-162-11/+5
| | | | _PyCompile_IsInteractive (#124061)
* gh-124068: Fix reference leak with generators in the free-threaded build ↵Sam Gross2024-09-141-0/+13
| | | | | | | (#124069) If the generator is already cleared, then most fields in the generator's frame are not valid other than f_executable. The invalid fields may contain dangling pointers and should not be used.
* gh-121459: Deferred LOAD_GLOBAL (GH-123128)Ken Jin2024-09-135-28/+30
| | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sam Gross <655866+colesbury@users.noreply.github.com>
* gh-124022: Fix bug where class docstring is removed in interactive mode ↵Irit Katriel2024-09-132-5/+5
| | | | | | | (#124023) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-124019: do not call codegen_annotations_in_scope if there are no ↵Irit Katriel2024-09-121-14/+10
| | | | annotations (#124020)
* gh-124013: remove _PyCompile_IsTopLevelAwait (#124014)Irit Katriel2024-09-122-25/+0
|
* gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` ↵Sam Gross2024-09-129-76/+102
| | | | | | | | (#123924) Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure ↵Mark Shannon2024-09-124-322/+291
| | | | that it is kept in memory for calls (GH-124003)
* gh-123958: apply docstring removal optimization in ast_opt instead of ↵Irit Katriel2024-09-112-22/+37
| | | | codegen (#123959)
* gh-123881: make compiler add the .generic_base base class without ↵Irit Katriel2024-09-102-46/+52
| | | | | | constructing AST nodes (#123883)
* gh-122239: Add actual count in unbalanced unpacking error message when ↵Tushar Sadhwani2024-09-101-0/+11
| | | | possible (#122244)
* gh-123892: Add "_wmi" to sys.stdlib_module_names (#123893)Victor Stinner2024-09-101-0/+1
|
* gh-121404: split compile.c into compile.c and codegen.c (#123651)Irit Katriel2024-09-093-6644/+6521
|
* gh-123275: Support `-Xgil=1` and `PYTHON_GIL=1` on non-free-threaded builds ↵Peter Bierma2024-09-051-4/+8
| | | | (gh-123276)
* GH-123545: Remove duplicate Py_DECREF when handling _PyOptimizer_Optimize ↵Savannah Ostrowski2024-09-052-8/+0
| | | | errors (GH-123546)
* gh-107954, PEP 741: Add PyInitConfig_AddModule() function (#123668)Victor Stinner2024-09-041-0/+35
|
* gh-107954, PEP 741: Adjust Python initialization config (#123663)Victor Stinner2024-09-041-3/+9
| | | | | | | Setting dev_mode to 1 in an isolated configuration now enables also faulthandler. Moreover, setting "module_search_paths" option with PyInitConfig_SetStrList() now sets "module_search_paths_set" to 1.
* gh-121804: always show error location for SyntaxError's in basic repl (#123202)Sergey B Kirpichev2024-09-031-0/+31
|
* gh-107954, PEP 741: Add PyInitConfig C API (#123502)Victor Stinner2024-09-031-8/+485
| | | Add Doc/c-api/config.rst documentation.
* gh-107954, PEP 741: Add PyConfig_Get()/Set() functions (#123472)Victor Stinner2024-09-022-194/+844
| | | | | | | | | | | Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and PyConfig_Names() functions to get and set the current runtime Python configuration. Add visibility and "sys spec" to config and preconfig specifications. _PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-121404: enforce that codegen doesn't access compiler, and compiler ↵Irit Katriel2024-09-021-85/+129
| | | | doesn't use codegen macros (#123575)
* gh-123091: Use more _Py_IsImmortalLoose() (GH-123602)Petr Viktorin2024-09-021-1/+1
| | | | | | | Switch more _Py_IsImmortal(...) assertions to _Py_IsImmortalLoose(...) The remaining calls to _Py_IsImmortal are in free-threaded-only code, initialization of core objects, tests, and guards that fall back to code that works with mortal objects.
* gh-123091: Use _Py_IsImmortalLoose() (#123511)Victor Stinner2024-09-023-6/+6
| | | | Use _Py_IsImmortalLoose() in bytesobject.c, typeobject.c and ceval.c.
* gh-123553: Fix compile warning in `compile.c` (#123578)sobolevn2024-09-011-0/+2
|
* gh-123553: Fix compiler warning in `Python/compile.c` (#123554)Kirill Podoprigora2024-09-011-0/+2
|
* gh-121404: rearrange code in compile.c so that codegen functions come first ↵Irit Katriel2024-08-301-1033/+1071
| | | | and compiler functions second (#123510)
* gh-122854: Add Py_HashBuffer() function (#122855)Victor Stinner2024-08-302-7/+10
|
* gh-121485: Always use 64-bit integers for integers bits count (GH-121486)Serhiy Storchaka2024-08-301-7/+7
| | | | | Use 64-bit integers instead of platform specific size_t or Py_ssize_t to represent the number of bits in Python integer.
* gh-123142: fix too wide source location of GET_ITER/GET_AITER (#123420)Irit Katriel2024-08-281-8/+7
|
* gh-123344: Add missing ast optimizations for PEP 696 (#123377)Bogdan Romanyuk2024-08-281-0/+3
| | | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-123271: Make builtin zip method safe under free-threading (#123272)Pieter Eendebak2024-08-271-1/+2
| | | | | | | | | | | | | | | | The `zip_next` function uses a common optimization technique for methods that generate tuples. The iterator maintains an internal reference to the returned tuple. When the method is called again, it checks if the internal tuple's reference count is 1. If so, the tuple can be reused. However, this approach is not safe under the free-threading build: after checking the reference count, another thread may perform the same check and also reuse the tuple. This can result in a double decref on the items of the replaced tuple and a double incref (memory leak) on the items of the tuple being set. This adds a function, `_PyObject_IsUniquelyReferenced` that encapsulates the stricter logic necessary for the free-threaded build: the internal tuple must be owned by the current thread, have a local refcount of one, and a shared refcount of zero.
* gh-121404: split compiler_nameop into a codegen part and a compiler part ↵Irit Katriel2024-08-271-89/+101
| | | | (#123398)
* GH-117759: Document incremental GC (GH-123266)Mark Shannon2024-08-271-11/+16
| | | | | | * Update what's new * Update gc module docs and fix inconsistency in gc.get_objects
* gh-121404: compiler_visit_* --> codegen_visit_* (#123382)Irit Katriel2024-08-271-61/+49
|
* GH-123232: Factor BINARY_SLICE and STORE_SLICE to handle stats properly for ↵Mark Shannon2024-08-273-34/+66
| | | | tier 2. (GH-123381)