summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.11.0b4v3.11.0b4Pablo Galindo2022-07-111-2/+2
|
* [3.11] GH-94262: Don't create frame objects for frames that aren't yet ↵Miss Islington (bot)2022-07-041-0/+17
| | | | | complete. (GH-94371) (#94482) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] GH-93354: Use exponential backoff to avoid excessive specialization ↵Mark Shannon2022-06-301-3/+44
| | | | | | attempts (GH-93355) (GH-93379) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.11] GH-93516: Backport GH-93769 (GH-94231)Mark Shannon2022-06-281-0/+1
| | | * Store offset of first traceable instruction to avoid having to recompute it all the time when tracing.
* [3.11] gh-90473: Reduce recursion limit on WASI even further (GH-94333) ↵Christian Heimes2022-06-271-3/+4
| | | | | (GH-94334) Co-authored-by: Christian Heimes <christian@python.org>
* [3.11] gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383) ↵Ken Jin2022-06-231-0/+1
| | | | | | (#93493) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* [3.11] GH-93516: Backport GH-93769: Speedup line number checks when tracing ↵Mark Shannon2022-06-222-1/+32
| | | | | (GH-94127) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)Victor Stinner2022-06-203-13/+23
| | | | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed. (cherry picked from commit 27b989403356ccdd47545a93aeab8434e9c69f21)
* gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid ↵Miss Islington (bot)2022-06-161-0/+2
| | | | | | | UB (GH-93700) (cherry picked from commit 65ff27c7d30b84655bf8caf6e396c65485708148) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] gh-91162: Support splitting of unpacked arbitrary-length tuple over ↵Miss Islington (bot)2022-06-142-0/+2
| | | | | | | | | | | | TypeVar and TypeVarTuple parameters (alt) (GH-93412) (GH-93746) For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int] (cherry picked from commit 3473817106c23eca7341c931453da0341c367e1d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91321: Fix compatibility with C++ older than C++11 (#93784) (#93802)Victor Stinner2022-06-141-2/+5
| | | | | | | | | | | * Fix the compatibility of the Python C API with C++ older than C++11. * _Py_NULL is only defined as nullptr on C++11 and newer. (cherry picked from commit 4caf5c2753f1aa28d6f4bc1aa377975fd2a62331) * test_cppext now builds the C++ extension with setuptools. * Add @test.support.requires_venv_with_pip. (cherry picked from commit ca0cc9c433830e14714a5cc93fb4e7254da3dd76)
* [3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() ↵Serhiy Storchaka2022-06-141-0/+3
| | | | | | | | | | (GH-93742) (GH-93792) It combines PyImport_ImportModule() and PyObject_GetAttrString() and saves 4-6 lines of code on every use. Add also _PyImport_GetModuleAttr() which takes Python strings as arguments. (cherry picked from commit 6fd4c8ec7740523bb81191c013118d9d6959bc9d)
* gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (GH-93500) (gh-93507)Miss Islington (bot)2022-06-051-0/+14
| | | | | | | | | | | | | | | | | Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile. Without this, you get an error like: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’ The modern way to use a NULL value in C++ is to use nullptr. However, we want to not break extensions that do things the old way. Co-authored-by: serge-sans-paille (cherry picked from commit 8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
* Post 3.11.0b3Pablo Galindo2022-06-011-1/+1
|
* Python 3.11.0b3v3.11.0b3Pablo Galindo2022-06-011-2/+2
|
* [3.11] gh-91162: Fix substitution of unpacked tuples in generic aliases ↵Miss Islington (bot)2022-06-012-2/+4
| | | | | | | | | | | | | (GH-92335) (#92484) * gh-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335) (cherry picked from commit 9d25db9db1617f012d7dba118b5b8f2b9e25e116) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Regenerate ABI file Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* Post 3.11.0b2Pablo Galindo2022-05-311-1/+1
|
* Python 3.11.0b2v3.11.0b2Pablo Galindo2022-05-301-2/+2
|
* [3.11] bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185) ↵Eric Snow2022-05-284-21/+0
| | | | | | | | | | | | | (GH-93306) (cherry picked from commit caa279d6fd5f151e57f891cd4f6ba51b532501c6) This was added for bpo-40514 (gh-84694) to test out a per-interpreter GIL. However, it has since proven unnecessary to keep the experiment in the repo. (It can be done as a branch in a fork like normal.) So here we are removing: * the configure option * the macro * the code enabled by the macro Automerge-Triggered-By: GH:ericsnowcurrently
* gh-92898: Enhance _testcppext test on cast to PyObject* (GH-93111)Miss Islington (bot)2022-05-261-25/+23
| | | | | | | * Add StrongRef class. * Rename and reformat functions of the _Py_CAST() implementation. (cherry picked from commit 20d30ba2ccf9182e4f08db112f428c909148a40b) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066) ↵Miss Islington (bot)2022-05-241-1/+13
| | | | | | | | | | | | (GH-93145) Also while there, clarify a few things about why we reduce the hash to 32 bits. Co-authored-by: Eli Libman <eli@hyro.ai> Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit c1f5c903a7e4ed27190488f4e33b00d3c3d952e5)
* [3.11] GH-92898: Make _Py_Cast C++ version compatible with cast operator ↵Dong-hee Na2022-05-211-2/+26
| | | | (gh-92951) (gh-93049)
* gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)Miss Islington (bot)2022-05-191-1/+7
| | | | | (cherry picked from commit 137fd3d88aa46669f5717734e823f4c594ab2843) Co-authored-by: Christian Heimes <christian@python.org>
* gh-89653: PEP 670: Fix PyUnicode_READ() cast (GH-92872)Miss Islington (bot)2022-05-171-1/+2
| | | | | | | _Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead. (cherry picked from commit e6fd7992a92879103215b3e9f218fe07212af9b1) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-92781: Avoid mixing declarations and code in C API (#92783) (#92813)Victor Stinner2022-05-163-9/+13
| | | | | | | Avoid mixing declarations and code in the C API to fix the compiler warning: "ISO C90 forbids mixed declarations and code" [-Werror=declaration-after-statement]. (cherry picked from commit 90e72300730189c4a48529baaad9b0005d40731c)
* gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (GH-92696) (GH-92703)Miss Islington (bot)2022-05-121-6/+12
| | | | | | | | | | | | | | | Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline functions of unicodeobject.h. Change also the kind type from unsigned int to int: same parameter type than PyUnicode_FromKindAndData(). The limited API version 3.11 no longer casts arguments to expected types. (cherry picked from commit d0c9353a79c2003385c83892db5dfd4e443474c9) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-89653: PEP 670: Use PyObject* type for parameters (GH-92694)Miss Islington (bot)2022-05-113-15/+20
| | | | | | | | | | | | Use the PyObject* type for parameters of static inline functions: * Py_SIZE(): same parameter type than PyObject_Size() * PyList_GET_SIZE(), PyList_SET_ITEM(): same parameter type than PyList_Size() and PyList_SetItem() * PyTuple_GET_SIZE(), PyTuple_SET_ITEM(): same parameter type than PyTuple_Size() and PyTuple_SetItem(). (cherry picked from commit 6de78ef96afbaa127472bb9dc0a4e41e44555d00) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-89653: PEP 670: Limited API doesn't cast arguments (GH-92654)Miss Islington (bot)2022-05-113-3/+13
| | | | | | | | | | | The limited API version 3.11 no longer casts arguments to expected types of functions of functions: * PyList_GET_SIZE(), PyList_SET_ITEM() * PyTuple_GET_SIZE(), PyTuple_SET_ITEM() * PyWeakref_GET_OBJECT() (cherry picked from commit 7d3b469e475e6e52ce4f0bad7198bb05ead77b1d) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-91731: Fix typo in pymacro.h (GH-92618)Miss Islington (bot)2022-05-101-1/+1
| | | | | | | | | | | | * Fix typo in pymacro.h * Update Include/pymacro.h Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit 4e6da502f42e3cbdffbe850833d2b04996232f0d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* gh-91731: Add macro compatibility for static_assert for old libcs (GH-92559) ↵Miss Islington (bot)2022-05-091-0/+8
| | | | | | | | | (#92566) (cherry picked from commit f0614ca9801d0768094570b784d2b26936bcca34) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* Post 3.11.0b1Pablo Galindo2022-05-081-1/+1
|
* Update the SOURCE_URI in pyspecific.py to point to the new branchv3.11.0b1Pablo Galindo2022-05-061-3/+3
|
* gh-91321: Fix _PyObject_EXTRA_INIT for C++ (#92396)Victor Stinner2022-05-061-1/+1
| | | | | | | | In C++, the _PyObject_EXTRA_INIT macro now uses nullptr, rather than 0, to initialize the _ob_next and _ob_prev members of the PyObject structure. Fix test_cppext failure when Python is built with ./configure --with-trace-refs.
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-061-3/+3
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()
* gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)Victor Stinner2022-05-051-0/+1
| | | | | | | | | | | | Add the -P command line option and the PYTHONSAFEPATH environment variable to not prepend a potentially unsafe path to sys.path. * Add sys.flags.safe_path flag. * Add PyConfig.safe_path member. * Programs/_bootstrap_python.c uses config.safe_path=0. * Update subprocess._optim_args_from_interpreter_flags() to handle the -P command line option. * Modules/getpath.py sets safe_path to 1 if a "._pth" file is present.
* gh-87390: Fix starred tuple equality and pickling (GH-92337)Serhiy Storchaka2022-05-052-0/+2
|
* gh-89653: PEP 670: Convert PyCFunction macros to functions (#92302)Victor Stinner2022-05-051-24/+56
| | | | | | | | | | Convert the following macros to static inline functions: * PyCFunction_GET_CLASS() * PyCFunction_GET_FLAGS() * PyCFunction_GET_FUNCTION() * PyCFunction_GET_SELF() Limited C API version 3.11 no longer casts arguments.
* Use static inline function Py_EnterRecursiveCall() (#91988)Victor Stinner2022-05-041-12/+8
| | | | | | | | | | | | | | | | Currently, calling Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() may use a function call or a static inline function call, depending if the internal pycore_ceval.h header file is included or not. Use a different name for the static inline function to ensure that the static inline function is always used in Python internals for best performance. Similar approach than PyThreadState_GET() (function call) and _PyThreadState_GET() (static inline function). * Rename _Py_EnterRecursiveCall() to _Py_EnterRecursiveCallTstate() * Rename _Py_LeaveRecursiveCall() to _Py_LeaveRecursiveCallTstate() * pycore_ceval.h: Rename Py_EnterRecursiveCall() to _Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() and _Py_LeaveRecursiveCall()
* Add more stats for freelist use and allocations. (GH-92211)Mark Shannon2022-05-031-0/+8
|
* gh-91321: Fix PyModuleDef_HEAD_INIT on C++ (#92259)Victor Stinner2022-05-031-5/+5
| | | | The PyModuleDef_HEAD_INIT macro now uses _Py_NULL to fix C++ compiler warnings when using it in C++.
* gh-91321: Add _Py_NULL macro (#92253)Victor Stinner2022-05-034-14/+22
| | | | | | | | Fix C++ compiler warnings: "zero as null pointer constant" (clang -Wzero-as-null-pointer-constant). * Add the _Py_NULL macro used by static inline functions to use nullptr in C++. * Replace NULL with nullptr in _testcppext.cpp.
* gh-91320: Fix more old-style cast warnings in C++ (#92247)Victor Stinner2022-05-032-16/+17
| | | | | | | Use _Py_CAST(), _Py_STATIC_CAST() and _PyASCIIObject_CAST() in static inline functions to fix C++ compiler warnings: "use of old-style cast" (clang -Wold-style-cast). test_cppext now builds the C++ test extension with -Wold-style-cast.
* gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)Victor Stinner2022-05-032-10/+43
| | | | | | | | | | | | Convert the following macros to static inline functions: * PyByteArray_AS_STRING() * PyByteArray_GET_SIZE() * PyBytes_AS_STRING() * PyBytes_GET_SIZE() Limited C API version 3.11 no longer casts arguments. Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
* gh-92031: Deoptimize Static Code at Finalization (GH-92039)Dennis Sweeney2022-05-031-0/+186
|
* gh-92135: Rename _Py_reinterpret_cast() to _Py_CAST() (#92230)Victor Stinner2022-05-039-24/+24
| | | Rename also _Py_static_cast() to _Py_STATIC_CAST().
* gh-92154: Expose PyCode_GetCode in the C API (GH-92168)Ken Jin2022-05-031-0/+3
|
* gh-92135: Fix _Py_reinterpret_cast() for const (#92138)Victor Stinner2022-05-023-9/+18
| | | | | | | | | | Fix C++ compiler warnings on cast macros, like _PyObject_CAST(), when casting a constant expression to a non constant type: use const_cast<> in C++. * In C++, Py_SAFE_DOWNCAST() now uses static_cast<> rather than reinterpret_cast<>. * Add tests to the _testcppext C++ extension. * test_cppext no longer captures stdout in verbose mode.
* gh-90822: Make `PY_SSIZE_T_MAX` and `PY_SSIZE_T_MIN` constant expression ↵Ganesh Kathiresan2022-05-021-5/+6
| | | | (GH-92071)
* bpo-43224: Implement substitution of unpacked TypeVarTuple in C (GH-31828)Serhiy Storchaka2022-04-302-0/+2
| | | | Co-authored-by: Matthew Rahtz <mrahtz@gmail.com>
* gh-91603: Speed up isinstance/issubclass on union types (GH-91631)Yurii Karabas2022-04-281-0/+1
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>