summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* GH-94262: Don't create frame objects for frames that aren't yet complete. ↵Mark Shannon2022-07-012-8/+13
| | | | (GH-94371)
* gh-88116: Avoid undefined behavior when decoding varints in code objects ↵Pablo Galindo Salgado2022-06-281-8/+8
| | | | (#94375)
* gh-87995: Make MappingProxyType hashable (GH-94252)Serhiy Storchaka2022-06-281-1/+7
|
* GH-94163: Add BINARY_SLICE and STORE_SLICE instructions. (GH-94168)Mark Shannon2022-06-271-17/+34
|
* gh-93382: Sync up `co_code` changes with 3.11 (GH-94227)Ken Jin2022-06-241-1/+1
| | | Sync up co_code changes with 3.11 commit 852b4d4bcd12b0b6839a015a262ce976b134f6f3.
* GH-91742: Fix pdb crash after jump (GH-94171)Kumar Aditya2022-06-231-1/+1
|
* gh-93021: Fix __text_signature__ for __get__ (GH-93023)Jelle Zijlstra2022-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.
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-214-39/+58
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* GH-93249: relax overly strict assertion on bounds->ar_start (GH-93961)Irit Katriel2022-06-201-1/+6
|
* GH-93516: Speedup line number checks when tracing. (GH-93763)Mark Shannon2022-06-201-0/+56
| | | | * Use a lookup table to reduce overhead of getting line numbers during tracing.
* GH-93897: Store frame size in code object and de-opt if insufficient space ↵Mark Shannon2022-06-202-1/+4
| | | | on thread frame stack. (GH-93908)
* gh-84461: Silence some compiler warnings on WASM (GH-93978)Christian Heimes2022-06-201-1/+1
|
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)Victor Stinner2022-06-192-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.
* GH-93990: fix refcounting bug in `add_subclass` in `typeobject.c` (GH-93989)Kumar Aditya2022-06-191-1/+4
|
* gh-93955: Use unbound methods for slot `__getattr__` and `__getattribute__` ↵Ken Jin2022-06-181-1/+8
| | | | (GH-93956)
* gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)Serhiy Storchaka2022-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).
* gh-92888: Fix memoryview bad `__index__` use after free (GH-92946)Ken Jin2022-06-171-19/+36
| | | | Co-authored-by: chilaxan <35645806+chilaxan@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
* gh-93911: Specialize `LOAD_ATTR_PROPERTY` (GH-93912)Ken Jin2022-06-171-10/+1
|
* Update includes in call.c (GH-93786)Pamela Fox2022-06-151-3/+2
|
* GH-93516: Store offset of first traceable instruction in code object (GH-93769)Mark Shannon2022-06-141-0/+6
|
* gh-89546: Clean up PyType_FromMetaclass (GH-93686)Petr Viktorin2022-06-141-90/+186
| | | | | | | | When changing PyType_FromMetaclass recently (GH-93012, GH-93466, GH-28748) I found a bunch of opportunities to improve the code. Here they are. Fixes: #89546 Automerge-Triggered-By: GH:encukou
* gh-79512: Fixed names and __module__ value of weakref classes (GH-93719)Serhiy Storchaka2022-06-141-3/+3
| | | | | Classes ReferenceType, ProxyType and CallableProxyType have now correct atrtributes __module__, __name__ and __qualname__. It makes them (types, not instances) pickleable.
* gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742)Serhiy Storchaka2022-06-143-26/+13
| | | | | | 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.
* GH-90699: use statically allocated strings in typeobject.c (gh-93751)Kumar Aditya2022-06-121-2/+2
|
* gh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749)Dong-hee Na2022-06-121-1/+1
|
* 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.