summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-102304: Temporarily Bump Py_LIMITED_API for 2 New Functions (#104766)Eric Snow2023-05-221-1/+1
| | | Quick and dirty.
* Merge branch 'main' of https://github.com/python/cpython into mainThomas Wouters2023-05-221-2/+3
|\
| * GH-101291: Avoid using macros with casts in low-level long API. (#104742)Mark Shannon2023-05-221-2/+3
| |
* | Python 3.13.0a0Thomas Wouters2023-05-221-4/+4
| |
* | Python 3.12.0b1v3.12.0b1Thomas Wouters2023-05-221-3/+3
|/
* gh-104656: Rename typeparams AST node to type_params (#104657)Jelle Zijlstra2023-05-222-28/+29
|
* GH-101291: Add low level, unstable API for pylong (GH-101685)Mark Shannon2023-05-213-20/+46
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-211-0/+13
| | | | | Co-authored-by: Aniket Panse <aniketpanse@fb.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-102856: Python tokenizer implementation for PEP 701 (#104323)Marta Gómez Macías2023-05-215-1/+9
| | | | | | | | | | | This commit replaces the Python implementation of the tokenize module with an implementation that reuses the real C tokenizer via a private extension module. The tokenize module now implements a compatibility layer that transforms tokens from the C tokenizer into Python tokenize tokens for backward compatibility. As the C tokenizer does not emit some tokens that the Python tokenizer provides (such as comments and non-semantic newlines), a new special mode has been added to the C tokenizer mode that currently is only used via the extension module that exposes it to the Python layer. This new mode forces the C tokenizer to emit these new extra tokens and add the appropriate metadata that is needed to match the old Python implementation. Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-94906: Support multiple steps in math.nextafter (#103881)Matthias Görgens2023-05-194-0/+6
| | | | | | | This PR updates `math.nextafter` to add a new `steps` argument. The behaviour is as though `math.nextafter` had been called `steps` times in succession. --------- Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* gh-104602: ensure all cellvars are known up front (#104603)Carl Meyer2023-05-191-2/+3
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-104549: Set __module__ on TypeAliasType (#104550)Jelle Zijlstra2023-05-182-1/+2
|
* gh-104615: don't make unsafe swaps in apply_static_swaps (#104620)Carl Meyer2023-05-185-1/+8
|
* GH-96803: Document and test new unstable internal frame API functions ↵Mark Shannon2023-05-181-1/+1
| | | | | | (GH-104211) Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.
* GH-104580: Don't cache eval breaker in interpreter (GH-104581)Mark Shannon2023-05-182-4/+4
| | | Move eval-breaker to the front of the interpreter state.
* GH-101520: Move tracemalloc functionality into core, leaving interface in ↵Mark Shannon2023-05-172-1/+34
| | | | Modules. (#104508)
* gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)Carl Meyer2023-05-162-3/+4
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-1614-40/+244
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104341: Adjust tstate_must_exit() to Respect Interpreter Finalization ↵Eric Snow2023-05-152-0/+19
| | | | | (gh-104437) With the move to a per-interpreter GIL, this check slipped through the cracks.
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-122-3/+3
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-114-46/+42
|
* GH-102181: Improve specialization stats for SEND (GH-102182)penguin_wwy2023-05-101-0/+2
|
* gh-104263: Rely on Py_NAN and introduce Py_INFINITY (GH-104202)Sebastian Berg2023-05-102-16/+11
| | | | | | | | | | This PR removes `_Py_dg_stdnan` and `_Py_dg_infinity` in favour of using the standard `NAN` and `INFINITY` macros provided by C99. This change has the side-effect of fixing a bug on MIPS where the hard-coded value used by `_Py_dg_stdnan` gave a signalling NaN rather than a quiet NaN. --------- Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* gh-104252: Immortalize Py_EMPTY_KEYS (gh-104253)Eric Snow2023-05-102-3/+6
| | | This was missed in gh-19474. It matters for with a per-interpreter GIL since PyDictKeysObject.dk_refcnt breaks isolation and leads to races.
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-096-16/+25
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-99113: A Per-Interpreter GIL! (gh-104210)Eric Snow2023-05-084-7/+4
| | | | | This is the culmination of PEP 684 (and of my 8-year long multi-core Python project)! Each subinterpreter may now be created with its own GIL (via Py_NewInterpreterFromConfig()). If not so configured then the interpreter will share with the main interpreter--the status quo since subinterpreters were added decades ago. The main interpreter always has its own GIL and subinterpreters from Py_NewInterpreter() will always share with the main interpreter.
* gh-104223: Fix issues with inheriting from buffer classes (#104227)Jelle Zijlstra2023-05-082-1/+3
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-104240: make _PyCompile_CodeGen support different compilation modes (#104241)Irit Katriel2023-05-075-1/+8
|
* gh-104018: remove unused format "z" handling in string formatfloat() (#104107)John Belmonte2023-05-071-2/+0
| | | This is a cleanup overlooked in PR #104033.
* gh-99113: Make Sure the GIL is Acquired at the Right Places (gh-104208)Eric Snow2023-05-061-0/+2
| | | This is a pre-requisite for a per-interpreter GIL. Without it this change isn't strictly necessary. However, there is no real downside otherwise.
* gh-99113: Add PyInterpreterConfig.own_gil (gh-104204)Eric Snow2023-05-053-1/+5
| | | | | We also add PyInterpreterState.ceval.own_gil to record if the interpreter actually has its own GIL. Note that for now we don't actually respect own_gil; all interpreters still share the one GIL. However, PyInterpreterState.ceval.own_gil does reflect PyInterpreterConfig.own_gil. That lie is a temporary one that we will fix when the GIL really becomes per-interpreter.
* gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205)Eric Snow2023-05-051-0/+1
| | | Here we are doing no more than adding the value for Py_mod_multiple_interpreters and using it for stdlib modules. We will start checking for it in gh-104206 (once PyInterpreterState.ceval.own_gil is added in gh-104204).
* gh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (gh-104148)Eric Snow2023-05-051-1/+6
| | | I'll be adding a value to indicate support for per-interpreter GIL in gh-99114.
* gh-99113: Share the GIL via PyInterpreterState.ceval.gil (gh-104203)Eric Snow2023-05-052-1/+4
| | | In preparation for a per-interpreter GIL, we add PyInterpreterState.ceval.gil, set it to the shared GIL for each interpreter, and use that rather than using _PyRuntime.ceval.gil directly. Note that _PyRuntime.ceval.gil is still the actual GIL.
* GH-96803: Add three C-API functions to make _PyInterpreterFrame less opaque ↵Mark Shannon2023-05-052-2/+17
| | | | for users of PEP 523. (GH-96849)
* GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)Brandt Bucher2023-05-051-0/+3
|
* gh-102500: Implement PEP 688 (#102521)Jelle Zijlstra2023-05-047-1/+38
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-104066: Improve performance of hasattr for module objects (#104063)Itamar Ostricher2023-05-041-0/+3
|
* gh-103323: Remove PyRuntimeState_GetThreadState() (#104171)Victor Stinner2023-05-041-8/+2
| | | | | This function no longer makes sense, since its runtime parameter is no longer used. Use directly _PyThreadState_GET() and _PyInterpreterState_GET() instead.
* gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)Petr Viktorin2023-05-045-5/+18
| | | | Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-104109: Expose Py_NewInterpreterFromConfig() in the Public C-API (gh-104110)Eric Snow2023-05-032-3/+3
| | | | | We also expose PyInterpreterConfig. This is part of the PEP 684 (per-interpreter GIL) implementation. We will add docs as soon as we can. FYI, I'm adding the new config field for per-interpreter GIL in gh-99114.
* gh-94673: More Per-Interpreter Fields for Builtin Static Types (gh-103912)Eric Snow2023-05-031-0/+7
| | | | | his involves moving tp_dict, tp_bases, and tp_mro to PyInterpreterState, in the same way we did for tp_subclasses. Those three fields are effectively const for builtin static types (unlike tp_subclasses). In theory we only need to make their values immortal, along with their contents. However, that isn't such a simple proposition. (See gh-103823.) In the meantime the simplest solution is to move the fields into the interpreter. One alternative is to statically allocate the values, but that's its own can of worms.
* GH-103963: Make dis display names of args for intrinsics opcodes (#104029)Juhi Chandalia2023-05-031-14/+12
|
* gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)Jurica Bradarić2023-05-021-0/+3
| | | | Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)Eric Snow2023-05-022-6/+14
| | | This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.
* gh-94673: Properly Initialize and Finalize Static Builtin Types for Each ↵Eric Snow2023-05-024-9/+14
| | | | | Interpreter (gh-104072) Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
* gh-87092: Expose assembler to unit tests (#103988)Irit Katriel2023-05-015-0/+10
|
* gh-97696: asyncio eager tasks factory (#102853)Itamar Ostricher2023-05-014-0/+12
| | | | Co-authored-by: Jacob Bower <jbower@meta.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (gh-104054)Eric Snow2023-05-011-2/+2
| | | This also does some cleanup.
* Fix typo in "expected" word in few source files (#104034)chgnrdv2023-05-011-1/+1
|