summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* GH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` ↵Mark Shannon2022-05-274-0/+23
| | | | (GH-93284)
* gh-82616: Add Py_IS_TYPE_SIGNED() macro (#93178)Victor Stinner2022-05-272-6/+7
| | | | | | _posixsubprocess: add a static assertion to ensure that the pid_t type is signed. Replace _Py_IntegralTypeSigned() with _Py_IS_TYPE_SIGNED().
* gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)Wenzel Jakob2022-05-271-0/+3
| | | | | | | | Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
* gh-92898: Enhance _testcppext test on cast to PyObject* (#93111)Victor Stinner2022-05-261-25/+23
| | | | * Add StrongRef class. * Rename and reformat functions of the _Py_CAST() implementation.
* gh-92777: Add LOAD_METHOD_LAZY_DICT (GH-92778)Ken Jin2022-05-252-31/+33
|
* gh-93202: Always use %zd printf formatter (#93201)Victor Stinner2022-05-252-37/+3
| | | | | | | | | | | | | | | | Python now always use the ``%zu`` and ``%zd`` printf formats to format a size_t or Py_ssize_t number. Building Python 3.12 requires a C11 compiler, so these printf formats are now always supported. * PyObject_Print() and _PyObject_Dump() now use the printf %zd format to display an object reference count. * Update PY_FORMAT_SIZE_T comment. * Remove outdated notes about the %zd format in PyBytes_FromFormat() and PyUnicode_FromFormat() documentations. * configure no longer checks for the %zd format and no longer defines PY_FORMAT_SIZE_T macro in pyconfig.h. * pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is no longer supported. Python 3.12 now requires macOS 10.6 (Snow Leopard) or newer.
* gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066)Yury Selivanov2022-05-231-1/+13
| | | | | | | 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>
* gh-92536: Mark PyUnicode_READY() argument as unused (#93011)Wenzel Jakob2022-05-231-2/+2
|
* gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)Victor Stinner2022-05-231-22/+6
| | | | | | | Update documentation of PyUnicode_DecodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault(): they now use the filesystem encoding and error handler of PyConfig, Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors variables are no longer used.
* GH-92898: Make _Py_Cast C++ version compatible with cast operator (gh-92951)serge-sans-paille2022-05-211-2/+26
|
* GH-89914: Make the oparg of the YIELD_VALUE instruction equal the stack ↵Mark Shannon2022-05-192-14/+14
| | | | depth. (GH-92960)
* gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)Christian Heimes2022-05-191-1/+7
|
* GH-90690: Remove `PRECALL` instruction (GH-92925)Mark Shannon2022-05-193-151/+136
|
* Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)Mark Shannon2022-05-181-0/+10
|
* bpo-42047: Add native thread ID for DragonFlyBSD (#22714)David CARLIER2022-05-181-1/+3
| | | | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-89653: Add assertions on PyUnicode_READ() index (#92883)Victor Stinner2022-05-171-1/+9
| | | | Add assertions on the index argument of PyUnicode_READ(), PyUnicode_READ_CHAR() and PyUnicode_WRITE() functions.
* gh-89653: PEP 670: Fix PyUnicode_READ() cast (#92872)Victor Stinner2022-05-171-1/+2
| | | | _Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead.
* Improve object stats (#92845)Mark Shannon2022-05-164-50/+84
| | | | | * Add incref/decref stats * Show ratios for allocation in summary
* gh-92781: Avoid mixing declarations and code in C API (#92783)Victor Stinner2022-05-155-11/+17
| | | | | 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].
* gh-85858: Remove PyUnicode_InternImmortal() function (#92579)Victor Stinner2022-05-132-14/+3
| | | | | | | | | | | | | | | | | Remove the PyUnicode_InternImmortal() function and the SSTATE_INTERNED_IMMORTAL macro. The PyUnicode_InternImmortal() function is still exported in the stable ABI. The function is removed from the API. PyASCIIObject.state.interned size is now a single bit, rather than 2 bits. Keep SSTATE_NOT_INTERNED and SSTATE_INTERNED_MORTAL macros for backward compatibility, but no longer use them internally since the interned member is now a single bit and so can only have two values (interned or not interned). Update stats of _PyUnicode_ClearInterned().
* gh-89653: Use int type for Unicode kind (#92704)Victor Stinner2022-05-131-2/+2
| | | | Use the same type that PyUnicode_FromKindAndData() kind parameter type (public C API): int.
* gh-89653: PEP 670: Convert PyUnicode_KIND() macro to function (#92705)Victor Stinner2022-05-131-1/+15
| | | | | | | | In the limited C API version 3.12, PyUnicode_KIND() is now implemented as a static inline function. Keep the macro for the regular C API and for the limited C API version 3.11 and older to prevent introducing new compiler warnings. Update _decimal.c and stringlib/eq.h for PyUnicode_KIND().
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-123-230/+15
|
* gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)Victor Stinner2022-05-111-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.
* gh-89653: PEP 670: Convert PyDict_GET_SIZE() macro to function (#92695)Victor Stinner2022-05-111-1/+9
| | | The limited C API version 3.12 no longer casts the argument.
* gh-89653: PEP 670: Use PyObject* type for parameters (#92694)Victor Stinner2022-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().
* gh-89653: Add assertions to unicodeobject.h functions (#92692)Victor Stinner2022-05-111-2/+8
|
* gh-89653: PEP 670: Limited API doesn't cast arguments (#92654)Victor Stinner2022-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()
* gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#92648)Victor Stinner2022-05-111-48/+66
| | | | | | | | | | | | | | | | | | | | Convert the following Unicode macros to static inline functions. Surrogate functions: * Py_UNICODE_IS_SURROGATE() * Py_UNICODE_IS_HIGH_SURROGATE() * Py_UNICODE_IS_LOW_SURROGATE() * Py_UNICODE_HIGH_SURROGATE() * Py_UNICODE_LOW_SURROGATE() * Py_UNICODE_JOIN_SURROGATES() "Is" functions: * Py_UNICODE_ISALNUM() * Py_UNICODE_ISSPACE() In the implementation of these functions, the character type is now well defined to Py_UCS4.
* gh-89653: PEP 670: Convert PyCell macros to functions (#92653)Victor Stinner2022-05-111-2/+17
| | | | | | | | | | | Convert the following macros to static inline functions: * PyCell_GET() * PyCell_SET() Limited C API version 3.12 no longer casts arguments. Fix also usage of PyCell_SET(): only delete the old value after setting the new value.
* gh-92651: Remove the Include/token.h header file (#92652)Victor Stinner2022-05-111-8/+11
| | | | | | | | | | | | | | | Remove the token.h header file. There was never any public tokenizer C API. The token.h header file was only designed to be used by Python internals. Move Include/token.h to Include/internal/pycore_token.h. Including this header file now requires that the Py_BUILD_CORE macro is defined. It no longer checks for the Py_LIMITED_API macro. Rename functions: * PyToken_OneChar() => _PyToken_OneChar() * PyToken_TwoChars() => _PyToken_TwoChars() * PyToken_ThreeChars() => _PyToken_ThreeChars()
* gh-89653: PEP 670: Convert pycore_gc.h macros to functions (#92649)Victor Stinner2022-05-111-23/+49
| | | | | | | | | | | | | | Convert the following macros to static inline functions: * _Py_AS_GC() * _PyGCHead_FINALIZED(), _PyGCHead_SET_FINALIZED() * _PyGCHead_NEXT(), _PyGCHead_SET_NEXT() * _PyGCHead_PREV(), _PyGCHead_SET_PREV() * _PyGC_FINALIZED(), _PyGC_SET_FINALIZED() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() Add a macro wrapping the _PyObject_GC_IS_TRACKED() function to cast the argument to PyObject*.
* gh-91731: Fix typo in pymacro.h (#92618)Pablo Galindo Salgado2022-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>
* gh-91731: Add macro compatibility for static_assert for old libcs (GH-92559)Pablo Galindo Salgado2022-05-091-0/+8
|
* gh-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335)Serhiy Storchaka2022-05-082-2/+4
|
* Python 3.12.0a0Pablo Galindo2022-05-081-4/+4
|
* 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().