summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* gh-94607: Fix subclassing generics (GH-94610)Miss Islington (bot)2022-07-091-0/+4
| | | | | | Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com> (cherry picked from commit 6442a9dd212fa18343db21849cf05c0181662c1f) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* [3.11] gh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and ↵Irit Katriel2022-07-061-8/+10
| | | | | | | POP_EXCEPT cases are no longer reachable (GH-94582) (GH-94595) (cherry picked from commit 50b9a7762f06335277d9962edc8d39498601a4e4) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.11] GH-94262: Don't create frame objects for frames that aren't yet ↵Miss Islington (bot)2022-07-042-8/+13
| | | | | complete. (GH-94371) (#94482) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.11] GH-94438: Backport GH-94444 (#94486)Mark Shannon2022-07-011-13/+35
| | | * Account for NULLs on evaluation stack when jumping lines.
* [3.11] GH-93516: Backport GH-93769 (GH-94231)Mark Shannon2022-06-281-0/+6
| | | * Store offset of first traceable instruction to avoid having to recompute it all the time when tracing.
* gh-88116: Avoid undefined behavior when decoding varints in code objects ↵Miss Islington (bot)2022-06-281-8/+8
| | | | | | | (GH-94375) (cherry picked from commit c485ec014ce174bb3f5ae948151dc40e0f6d5f7f) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] GH-91742: Fix pdb crash after jump (GH-94171) (#94176)Miss Islington (bot)2022-06-231-1/+1
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-93382: Cache result of `PyCode_GetCode` in codeobject (GH-93383) ↵Ken Jin2022-06-231-0/+8
| | | | | | (#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-221-0/+56
| | | | | (GH-94127) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-93021: Fix __text_signature__ for __get__ (GH-93023) (GH-94085)Miss Islington (bot)2022-06-211-2/+2
| | | | | | | | Because of the way wrap_descr_get is written, the second argument to __get__ methods implemented through the wrapper is always optional. (cherry picked from commit 4e08fbcfdfa57ea94091aabdd09413708e3fb2bf) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-93249: relax overly strict assertion on bounds->ar_start (GH-93961) ↵Miss Islington (bot)2022-06-201-1/+6
| | | | | | | | | (GH-94032) (cherry picked from commit 1603a1029f44f0fdc87c65b02063229962194f84) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)Victor Stinner2022-06-202-2/+0
| | | | | | | | | | | | | | | | | | 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-84461: Silence some compiler warnings on WASM (GH-93978)Miss Islington (bot)2022-06-201-1/+1
| | | | | (cherry picked from commit 774ef28814d0d9d57ec813cb31b0a7af6c476127) Co-authored-by: Christian Heimes <christian@python.org>
* GH-93990: fix refcounting bug in `add_subclass` in `typeobject.c` (GH-93989)Miss Islington (bot)2022-06-191-1/+4
| | | | | (cherry picked from commit 726448ebe15cd78e180c29c9858cb6c10a581524) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-89828: Do not relay the __class__ attribute in GenericAlias (GH-93754)Miss Islington (bot)2022-06-181-0/+1
| | | | | | | | list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type). (cherry picked from commit f9433fff476aa13af9cb314fcc6962055faa4085) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-92888: Fix memoryview bad `__index__` use after free (GH-92946)Miss Islington (bot)2022-06-181-19/+36
| | | | | | | Co-authored-by: chilaxan <35645806+chilaxan@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com> (cherry picked from commit 11190c4ad0d3722b8d263758ac802985131a5462) Co-authored-by: Ken Jin <kenjin@python.org>
* gh-92914: Round the allocated size for lists up to the even number (GH-92915)Miss Islington (bot)2022-06-141-0/+6
| | | | | (cherry picked from commit 8a6af5a34642f5564220eb50d72caada8f17fc78) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-79512: Fixed names and __module__ value of weakref classes (GH-93719)Miss Islington (bot)2022-06-141-3/+3
| | | | | | | | Classes ReferenceType, ProxyType and CallableProxyType have now correct atrtributes __module__, __name__ and __qualname__. It makes them (types, not instances) pickleable. (cherry picked from commit 8352e322e87ba39c71e578b65ad8ae156ca3e0c7) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-91162: Support splitting of unpacked arbitrary-length tuple over ↵Miss Islington (bot)2022-06-141-56/+43
| | | | | | | | | | | | 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>
* Fix missing word in sys.float_info docstring (GH-93489) (GH-93495)Miss Islington (bot)2022-06-041-1/+1
| | | | | | | (cherry picked from commit e12f34b6d8200508bd50cdc9c6c5637732ff56e7) Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple ↵Miss Islington (bot)2022-06-011-1/+1
| | | | | | | | (GH-93346) For example: tuple[*Ts, list[T]][int, str, bool] (cherry picked from commit f545fc955aeb701ae4e73b07ff2283f823d857b8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.11] gh-91162: Fix substitution of unpacked tuples in generic aliases ↵Miss Islington (bot)2022-06-011-13/+108
| | | | | | | | | | | | | (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>
* [3.11] bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185) ↵Eric Snow2022-05-282-40/+3
| | | | | | | | | | | | | (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-92804: Fix memory leak in memoryview iterator (gh-92805)Miss Islington (bot)2022-05-142-3/+5
| | | | | (cherry picked from commit d923fdf54bc97baece879179ba4971f632b9722b) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* 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.