summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-93728: fix memory leak in deepfrozen code objects (GH-93729)Kumar Aditya2022-06-121-0/+1
|
* gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar ↵Serhiy Storchaka2022-06-121-56/+43
| | | | | | | | | and TypeVarTuple parameters (alt) (GH-93412) For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
* gh-93466: Document PyType_Spec doesn't accept repeated slot IDs; raise where ↵Petr Viktorin2022-06-101-2/+14
| | | | this was problematic (GH-93471)
* bpo-45383: Get metaclass from bases in PyType_From* (GH-28748)Sebastian Berg2022-06-091-94/+127
| | | | | | | | | This checks the bases of of a type created using the FromSpec API to inherit the bases metaclasses. The metaclass's alloc function will be called as is done in `tp_new` for classes created in Python. Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* Fix missing word in sys.float_info docstring (GH-93489)Mark Dickinson2022-06-041-1/+1
|
* gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383)Ken Jin2022-06-032-0/+15
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* gh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler ↵Dennis Sweeney2022-05-311-0/+27
| | | | (GH-93144)
* gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple ↵Serhiy Storchaka2022-05-311-1/+1
| | | | | | (GH-93346) For example: tuple[*Ts, list[T]][int, str, bool]
* bpo-41287: Handle `doc` argument of `property.__init__` in subclasses (#23205)Sergei Izmailov2022-05-291-18/+35
| | | | | Fixes #85459 Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185)Eric Snow2022-05-272-39/+3
| | | | | | | 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
* GH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` ↵Mark Shannon2022-05-274-3/+17
| | | | (GH-93284)
* GH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h (#93215)Kumar Aditya2022-05-273-12/+0
|
* gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)Wenzel Jakob2022-05-271-9/+26
| | | | | | | | 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-91924: Optimize unicode_check_encoding_errors() (#93200)Victor Stinner2022-05-261-2/+16
| | | | | | Avoid _PyCodec_Lookup() and PyCodec_LookupError() for most common built-in encodings and error handlers to avoid creating a temporary Unicode string object, whereas these encodings and error handlers are known to be valid.
* Remove unnecessary for loop initializer in long_lshift1() (GH-93071)oda-gitso2022-05-251-1/+1
| | | | | * Remove unnecessary for loop initialization.
* gh-93202: Always use %zd printf formatter (#93201)Victor Stinner2022-05-251-7/+2
| | | | | | | | | | | | | | | | 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-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED (#93175)oda-gitso2022-05-251-13/+14
|
* gh-93033: Use wmemchr in stringlib (GH-93034)goldsteinn2022-05-2410-14/+38
| | | | | Generally comparable perf for the "good" case where memchr doesn't return any collisions (false matches on lower byte) but clearly faster with collisions.
* GH-92955: fix memory leak in code object lines and positions iterators ↵Kumar Aditya2022-05-192-4/+8
| | | | (gh-92956)
* gh-92914: Round the allocated size for lists up to the even number (GH-92915)Serhiy Storchaka2022-05-191-0/+6
|
* Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)Mark Shannon2022-05-181-0/+2
|
* GH-92804: Fix memory leak in memoryview iterator (gh-92805)Kumar Aditya2022-05-142-3/+5
|
* gh-90861: Memory optimization for set.issubset (gh-92799)Dong-hee Na2022-05-141-5/+5
|
* gh-85858: Remove PyUnicode_InternImmortal() function (#92579)Victor Stinner2022-05-131-52/+17
| | | | | | | | | | | | | | | | | 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-134-32/+32
| | | | 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-3/+0
| | | | | | | | 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-91578: improved error message when trying to instantiate an abstract ↵ravi1402222022-05-121-1/+1
| | | | class with missing methods (gh-47246)
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-123-1065/+94
|
* gh-89653: PEP 670: Convert PyCell macros to functions (#92653)Victor Stinner2022-05-112-9/+8
| | | | | | | | | | | 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-89653: PEP 670: Convert pycore_gc.h macros to functions (#92649)Victor Stinner2022-05-111-1/+1
| | | | | | | | | | | | | | 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-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335)Serhiy Storchaka2022-05-081-13/+108
|
* Issues/88027: A potential double free in list_sort_impl (#92367)Tim Peters2022-05-061-1/+3
| | | merge_freemem(): set keys to NULL do it's harmless to call this again.
* gh-92112: Fix crash triggered by an evil custom `mro()` (#92113)Alexey Izbyshev2022-05-061-9/+11
|
* gh-87390: Fix starred tuple equality and pickling (GH-92337)Serhiy Storchaka2022-05-051-0/+26
|
* bpo-43857: Improve the AttributeError message when deleting a missing ↵Géry Ogam2022-05-052-5/+17
| | | | | attribute (#25424) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46764: Fix wrapping bound method with @classmethod (#31367)Michael J. Sullivan2022-05-051-8/+0
|
* Use static inline function Py_EnterRecursiveCall() (#91988)Victor Stinner2022-05-047-45/+46
| | | | | | | | | | | | | | | | 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-036-0/+28
|
* gh-91320: Use _PyCFunction_CAST() (#92251)Victor Stinner2022-05-036-17/+17
| | | | | | | | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func). Change generated by the command: sed -i -e \ 's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \ $(find -name "*.c")
* gh-91320: Argument Clinic uses _PyCFunction_CAST() (#32210)Victor Stinner2022-05-0312-77/+77
| | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func).
* gh-92031: Deoptimize Static Code at Finalization (GH-92039)Dennis Sweeney2022-05-031-10/+17
|
* gh-92154: Expose PyCode_GetCode in the C API (GH-92168)Ken Jin2022-05-031-0/+5
|
* Fix the closure argument to PyEval_EvalCodeEx. (GH-92175)larryhastings2022-05-021-1/+2
|
* gh-87390: Add __unpacked__ attribute to types.GenericAlias (#92059)Jelle Zijlstra2022-05-021-0/+2
|
* gh-90213: Speed up right shifts of negative integers (GH-30277)Mark Dickinson2022-05-021-29/+69
|
* bpo-36819: Fix crashes in built-in encoders with weird error handlers (GH-28593)Serhiy Storchaka2022-05-022-23/+52
| | | | | | | If the error handler returns position less or equal than the starting position of non-encodable characters, most of built-in encoders didn't properly re-size the output buffer. This led to out-of-bounds writes, and segfaults.
* gh-92114: Improve error message for types with __class_getitem__ = None ↵Serhiy Storchaka2022-05-021-1/+2
| | | | (GH-92115)
* gh-81548: Deprecate octal escape sequences with value larger than 0o377 ↵Serhiy Storchaka2022-04-302-10/+48
| | | | (GH-91668)
* bpo-43224: Implement substitution of unpacked TypeVarTuple in C (GH-31828)Serhiy Storchaka2022-04-301-14/+104
| | | | Co-authored-by: Matthew Rahtz <mrahtz@gmail.com>
* gh-91603: Speed up isinstance/issubclass on union types (GH-91631)Yurii Karabas2022-04-282-74/+15
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>