summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.12.0a2v3.12.0a2Thomas Wouters2022-11-141-2/+2
|
* gh-83638: Add sqlite3.Connection.autocommit for PEP 249 compliant behaviour ↵Erlend E. Aasland2022-11-124-0/+5
| | | | | | | | | | (#93823) Introduce the autocommit attribute to Connection and the autocommit parameter to connect() for PEP 249-compliant transaction handling. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
* gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)Eric Snow2022-11-123-0/+4
| | | | | 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-116-15/+877
| | | | | 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-114-2/+30
| | | | | 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-114-0/+52
| | | | | 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-81057: Generate a Separate Initializer For Each Part of the Global ↵Eric Snow2022-11-113-1469/+1479
| | | | | | | Objects Initializer (gh-99389) Up until now we had a single generated initializer macro for all the statically declared global objects in _PyRuntimeState, including several one-offs (e.g. the empty tuple). The one-offs don't need to be generated, but were because we had one big initializer. Having separate initializers for set of generated global objects allows us to generate only the ones we need to. This allows us to add initializers for one-off global objects without having to generate them. https://github.com/python/cpython/issues/81057
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-108-94/+108
| | | | | | * 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-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-093-136/+148
|
* GH-90699: disallow `_Py_IDENTIFIER` in core code (GH-99210)Kumar Aditya2022-11-091-2/+2
|
* gh-98724: Fix Py_CLEAR() macro side effects (#99100)Victor Stinner2022-11-092-27/+36
| | | | | | | The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated. Add test_py_clear() and test_py_setref() unit tests to _testcapi.
* gh-90868: Add _PyStaticObject_CheckRefcnt() function (#99261)Victor Stinner2022-11-091-5777/+1456
| | | | | | Add _PyStaticObject_CheckRefcnt() function to make _PyStaticObjects_CheckRefcnt() shorter. Use _PyObject_ASSERT_FAILED_MSG() to log the object causing the fatal error.
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-083-7081/+7114
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* gh-91248: Add PyFrame_GetVar() function (#95712)Victor Stinner2022-11-081-1/+2
| | | | | | Add PyFrame_GetVar() and PyFrame_GetVarString() functions to get a frame variable by its name. Move PyFrameObject C API tests from test_capi to test_frame.
* GH-90699: Remove remaining `_Py_IDENTIFIER` stdlib usage (GH-99067)Kumar Aditya2022-11-073-7/+71
|
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-074-44/+47
|
* gh-99139: Improve NameError error suggestion for instances (#99140)Pablo Galindo Salgado2022-11-062-0/+8
|
* gh-98284: better error message for undefined abstractmethod (#97971)Kaushik Kulkarni2022-11-052-6/+0
|
* GH-90699: Remove `_Py_IDENTIFIER` usage from `_ctypes` (GH-99054)Kumar Aditya2022-11-032-0/+128
|
* GH-96793: Implement PEP 479 in bytecode. (GH-99006)Mark Shannon2022-11-032-49/+50
| | | | | * Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-024-75/+52
|
* GH-90699: Remove `_Py_IDENTIFIER` usage from `_asyncio` module (#99010)Kumar Aditya2022-11-022-0/+128
|
* GH-90699: Remove `_Py_IDENTIFIER` usage from `_json` module (GH-98956)Kumar Aditya2022-11-022-0/+38
|
* gh-87092: do not allocate PyFutureFeatures dynamically (GH-98913)Irit Katriel2022-11-021-3/+4
|
* gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618)Eric Snow2022-10-312-8/+19
| | | | | | | Previously, the optional restrictions on subinterpreters were: disallow fork, subprocess, and threads. By default, we were disallowing all three for "isolated" interpreters. We always allowed all three for the main interpreter and those created through the legacy `Py_NewInterpreter()` API. Those settings were a bit conservative, so here we've adjusted the optional restrictions to: fork, exec, threads, and daemon threads. The default for "isolated" interpreters disables fork, exec, and daemon threads. Regular threads are allowed by default. We continue always allowing everything For the main interpreter and the legacy API. In the code, we add `_PyInterpreterConfig.allow_exec` and `_PyInterpreterConfig.allow_daemon_threads`. We also add `Py_RTFLAGS_DAEMON_THREADS` and `Py_RTFLAGS_EXEC`.
* gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)David Hewitt2022-10-312-4/+3
| | | This adds them to the Limited API.
* gh-98811: use full source location to simplify __future__ imports error ↵Irit Katriel2022-10-311-2/+17
| | | | checking. This also fixes an incorrect error offset. (GH-98812)
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` ↵Nikita Sobolev2022-10-301-1/+1
| | | | (#98806)
* GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)Mark Shannon2022-10-272-92/+93
| | | | Change FOR_ITER to have the same stack effect regardless of whether it branches or not. Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-272-13/+16
| | | Expose the facilities for making vector calls through Python's limited API.
* gh-98608: Change _Py_NewInterpreter() to _Py_NewInterpreterFromConfig() ↵Eric Snow2022-10-264-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | | (gh-98609) (see https://github.com/python/cpython/issues/98608) This change does the following: 1. change the argument to a new `_PyInterpreterConfig` struct 2. rename the function to `_Py_NewInterpreterFromConfig()`, inspired by `Py_InitializeFromConfig()` (takes a `_PyInterpreterConfig` instead of `isolated_subinterpreter`) 3. split up the boolean `isolated_subinterpreter` into the corresponding multiple granular settings * allow_fork * allow_subprocess * allow_threads 4. add `PyInterpreterState.feature_flags` to store those settings 5. add a function for checking if a feature is enabled on an opaque `PyInterpreterState *` 6. drop `PyConfig._isolated_interpreter` The existing default (see `Py_NewInterpeter()` and `Py_Initialize*()`) allows fork, subprocess, and threads and the optional "isolated" interpreter (see the `_xxsubinterpreters` module) disables all three. None of that changes here; the defaults are preserved. Note that the given `_PyInterpreterConfig` will not be used outside `_Py_NewInterpreterFromConfig()`, nor preserved. This contrasts with how `PyConfig` is currently preserved, used, and even modified outside `Py_InitializeFromConfig()`. I'd rather just avoid that mess from the start for `_PyInterpreterConfig`. We can preserve it later if we find an actual need. This change allows us to follow up with a number of improvements (e.g. stop disallowing subprocess and support disallowing exec instead). (Note that this PR adds "private" symbols. We'll probably make them public, and add docs, in a separate change.)
* gh-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-253-0/+16
|
* Post 3.12.0a1Thomas Wouters2022-10-251-1/+1
|
* Python 3.12.0a1v3.12.0a1Thomas Wouters2022-10-241-2/+2
|
* gh-91051: allow setting a callback hook on PyType_Modified (GH-97875)Carl Meyer2022-10-212-0/+12
|
* gh-95023: Added os.setns and os.unshare functions (#95046)Noam Cohen2022-10-202-0/+8
| | | | | | | | Added os.setns and os.unshare to easily switch between namespaces on Linux. Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-98417: Store int_max_str_digits on the Interpreter State (GH-98418)Eric Snow2022-10-191-0/+6
|
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-175-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Create Tools/build/ directory. Move the following scripts from Tools/scripts/ to Tools/build/: * check_extension_modules.py * deepfreeze.py * freeze_modules.py * generate_global_objects.py * generate_levenshtein_examples.py * generate_opcode_h.py * generate_re_casefix.py * generate_sre_constants.py * generate_stdlib_module_names.py * generate_token.py * parse_html5_entities.py * smelly.py * stable_abi.py * umarshal.py * update_file.py * verify_ensurepip_wheels.py Update references to these scripts.
* gh-95756: Lazily created cached co_* attrs (GH-97791)Ken Jin2022-10-111-1/+8
|
* gh-95011: Migrate syslog module to Argument Clinic (GH-95012)Noam Cohen2022-10-082-0/+24
|
* gh-97922: Run the GC only on eval breaker (#97920)Pablo Galindo Salgado2022-10-082-0/+4
|
* gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)Carl Meyer2022-10-081-0/+1
|
* gh-97955: Migrate `zoneinfo` to Argument Clinic (#97958)Nikita Sobolev2022-10-072-0/+8
|
* Make _symtable_entry.ste_type's comment consistent wit _Py_block_ty (#92414)zikcheng2022-10-071-1/+1
| | | | _Py_block_ty defines four types of block, FunctionBlock, ClassBlock, ModuleBlock and AnnotationBlock. But _symtable_entry.ste_type only comments three of them, I think it's better both sides are consistent.
* gh-64373: Convert `_functools` to Argument Clinic (#96640)Nikita Sobolev2022-10-072-0/+8
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-073-1/+51
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-053-15/+24
| | | | (GH-96510)
* gh-96512: Move int_max_str_digits setting to PyConfig (#96944)Gregory P. Smith2022-10-033-4/+1
| | | | | | | | | | | It had to live as a global outside of PyConfig for stable ABI reasons in the pre-3.12 backports. This removes the `_Py_global_config_int_max_str_digits` and gets rid of the equivalent field in the internal `struct _is PyInterpreterState` as code can just use the existing nested config struct within that. Adds tests to verify unique settings and configs in subinterpreters.
* gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)Pablo Galindo Salgado2022-09-271-0/+1
|
* gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961)Serhiy Storchaka2022-09-241-2/+2
|