summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* gh-91603: Speed up operator "|" for UnionType (GH-91955)Serhiy Storchaka2022-04-281-87/+70
| | | | | | | | | Reduce the complexity from O((M+N)^2) to O(M*N), where M and N are the length of __args__ for both operands (1 for operand which is not a UnionType). As a consequence, the complexity of parameter substitution in UnionType has been reduced from O(N^3) to O(N^2). Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
* gh-91719: Add pycore_opcode.h internal header file (#91906)Victor Stinner2022-04-253-4/+6
| | | | | | | | | | | Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
* gh-89373: _Py_Dealloc() checks tp_dealloc exception (#32357)Victor Stinner2022-04-211-1/+35
| | | | If Python is built in debug mode, _Py_Dealloc() now ensures that the tp_dealloc function leaves the current exception unchanged.
* GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty ↵Mark Shannon2022-04-211-1/+15
| | | | less dangerous. (GH-91790)
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-214-215/+417
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-91636: Don't clear required fields of function objects (GH-91651)Dennis Sweeney2022-04-211-3/+11
|
* gh-91731: Replace Py_BUILD_ASSERT() with static_assert() (#91730)Victor Stinner2022-04-202-3/+7
| | | | | | | | | | | | Python 3.11 now uses C11 standard which adds static_assert() to <assert.h>. * In pytime.c, replace Py_BUILD_ASSERT() with preprocessor checks on SIZEOF_TIME_T with #error. * On macOS, py_mach_timebase_info() now accepts timebase members with the same size than _PyTime_t. * py_get_monotonic_clock() now saturates GetTickCount64() to _PyTime_MAX: GetTickCount64() is unsigned, whereas _PyTime_t is signed.
* Cast to (destructor) to fix compiler warnings (GH-91711)Dennis Sweeney2022-04-201-1/+1
|
* gh-91632: Fix generic_alias_iterator to be finalized at exit. (GH-91727)Dong-hee Na2022-04-202-2/+6
|
* gh-91020: Add `PyBytes_Type.tp_alloc` for subclass (GH-91686)Inada Naoki2022-04-201-1/+20
|
* gh-90667: Add specializations of Py_DECREF when types are known (GH-30872)Dennis Sweeney2022-04-196-35/+61
|
* bpo-46712: share more global strings in deepfreeze (gh-32152)Kumar Aditya2022-04-191-0/+1
| | | (for gh-90868)
* bpo-40421: Cleanup PyFrame C API (GH-32417)Victor Stinner2022-04-191-1/+1
|
* gh-91098: Use Argument Clinic for Object/classobject.c to fix docstrings ↵Oleg Iarygin2022-04-192-114/+168
| | | | | | | (#31711) Closes GH-91098. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-91102: Use Argument Clinic for EncodingMap (#31725)Oleg Iarygin2022-04-182-48/+42
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-91576: Speed up iteration of strings (#91574)Kumar Aditya2022-04-182-6/+46
|
* gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)Oleg Iarygin2022-04-183-7/+9
| | | | Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-89770: Implement PEP-678 - Exception notes (GH-31317)Irit Katriel2022-04-161-43/+80
|
* gh-91266: refactor bytearray strip methods (GH-32096)Pieter Eendebak2022-04-141-85/+40
|
* gh-91502: Add a new API to check if a frame is an entry frame (GH-91503)Pablo Galindo Salgado2022-04-131-0/+8
|
* gh-91421: Use constant value check during runtime (GH-91422)Tobias Stoeckmann2022-04-131-1/+1
| | | | | | | | | | | | | The left-hand side expression of the if-check can be converted to a constant by the compiler, but the addition on the right-hand side is performed during runtime. Move the addition from the right-hand side to the left-hand side by turning it into a subtraction there. Since the values are known to be large enough to not turn negative, this is a safe operation. Prevents a very unlikely integer overflow on 32 bit systems. Fixes GH-91421.
* gh-91117: Ensure integer mod and pow operations use cached small ints (GH-31843)Dennis Sweeney2022-04-111-0/+2
|
* GH-89480: Document motivation, design and implementation of 3.11 frame ↵Mark Shannon2022-04-111-0/+122
| | | | stack. (GH-32304)
* bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)John Belmonte2022-04-112-6/+13
| | | | | | | | Add "z" format specifier to coerce negative 0 to zero. See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995) for discussion. This covers `str.format()` and f-strings. Old-style string interpolation is not supported. Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-2/+12
|
* Fix bad grammar and import docstring for split/rsplit (GH-32381)Raymond Hettinger2022-04-082-22/+37
|
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-1/+11
|
* bpo-47250: Fix refleak from object.__getstate__() (GH-32403)Dong-hee Na2022-04-071-1/+0
| | | Co-authored-by: Brandt Bucher <brandt@python.org>
* bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)Brandt Bucher2022-04-073-29/+27
|
* bpo-35134: Remove the Include/code.h header file (GH-32385)Victor Stinner2022-04-071-1/+0
| | | | | | Remove the Include/code.h header file. C extensions should only include the main <Python.h> header file. Python.h includes directly Include/cpython/code.h instead.
* bpo-26579: Add object.__getstate__(). (GH-2821)Serhiy Storchaka2022-04-065-145/+172
| | | | | | | Copying and pickling instances of subclasses of builtin types bytearray, set, frozenset, collections.OrderedDict, collections.deque, weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes implemented as slots.