summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* clarify the 4300-digit limit on int-str conversion (#100175)Ned Batchelder2022-12-121-2/+2
|
* GH-98522: Add version number to code objects. (GH-98525)Mark Shannon2022-12-092-4/+5
| | | | | | * Add version number to code object for better versioning of functions. * Improves specialization for closures and list comprehensions.
* GH-100110: Specialize FOR_ITER for tuples (GH-100109)Ken Jin2022-12-091-14/+9
| | | * Specialize FOR_ITER for tuples
* gh-81057: Move More Globals to _PyRuntimeState (gh-100092)Eric Snow2022-12-072-4/+7
| | | https://github.com/python/cpython/issues/81057
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-038-20/+20
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* GH-91054: Add code object watchers API (GH-99859)Itamar Ostricher2022-12-021-0/+63
| | | | | | * Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
* gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)Serhiy Storchaka2022-12-011-0/+3
| | | | Previously *consumed was not set in this case.
* gh-89189: More compact range iterator (GH-27986)Serhiy Storchaka2022-11-301-37/+42
|
* gh-99845: Use size_t type in __sizeof__() methods (#99846)Victor Stinner2022-11-303-14/+11
| | | | | | | | The implementation of __sizeof__() methods using _PyObject_SIZE() now use an unsigned type (size_t) to compute the size, rather than a signed type (Py_ssize_t). Cast explicitly signed (Py_ssize_t) values to unsigned type (Py_ssize_t).
* gh-99845: Clean up _PyObject_VAR_SIZE() usage (#99847)Victor Stinner2022-11-292-11/+12
| | | | | | * code_sizeof() now uses an unsigned type (size_t) to compute the result. * Fix _PyObject_ComputedDictPointer(): cast _PyObject_VAR_SIZE() to Py_ssize_t, rather than long: it's a different type on 64-bit Windows. * Clarify that _PyObject_VAR_SIZE() uses an unsigned type (size_t).
* gh-99845: Change _PyDict_KeysSize() return type to size_t (#99848)Victor Stinner2022-11-292-34/+30
| | | | | | | | * Change _PyDict_KeysSize() and shared_keys_usable_size() return type from signed (Py_ssize_t) to unsigned (size_t) type. * new_values() argument type is now unsigned (size_t). * init_inline_values() now uses size_t rather than int for the 'i' iterator variable. * type.__sizeof__() implementation now uses unsigned (size_t) type.
* gh-89682: [doc] reword docstring of __contains__ to clarify that it returns ↵Ivan Savov2022-11-261-1/+1
| | | | a bool (GH-29043)
* gh-98724: Fix warnings on Py_SETREF() usage (#99781)Victor Stinner2022-11-252-2/+2
| | | Cast argument to the expected type.
* gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)Victor Stinner2022-11-235-26/+13
| | | Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
* gh-99537: Use Py_SETREF() function in C code (#99657)Victor Stinner2022-11-2211-51/+23
| | | | | | | | | | | | | | | Fix potential race condition in code patterns: * Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" * Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);" * Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);" Other changes: * Replace "old = var; var = new; Py_DECREF(var)" with "Py_SETREF(var, new);" * Replace "old = var; var = new; Py_XDECREF(var)" with "Py_XSETREF(var, new);" * And remove the "old" variable.
* gh-91053: Add an optional callback that is invoked whenever a function is ↵mpage2022-11-221-0/+68
| | | | modified (#98175)
* gh-99537: Use Py_SETREF() function in longobject C code (#99655)Victor Stinner2022-11-221-49/+24
| | | | Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" in longobject.c and _testcapi/long.c.
* gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException ↵Irit Katriel2022-11-181-1/+13
| | | | (GH-99572)
* gh-99443: `descr_set_trampoline_call` return type should be `int` not ↵Hood Chatham2022-11-161-1/+1
| | | | `PyObject*` (#99444)
* Remove old comment (GH-99489)Brandt Bucher2022-11-161-9/+0
|
* gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)Eric Snow2022-11-164-18/+11
| | | | | We also move the global func version. https://github.com/python/cpython/issues/81057
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)Victor Stinner2022-11-168-35/+17
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)Eric Snow2022-11-163-14/+34
| | | https://github.com/python/cpython/issues/81057
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)Victor Stinner2022-11-163-16/+8
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)Eric Snow2022-11-152-7/+1
| | | | | This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
* gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)Eric Snow2022-11-141-25/+20
| | | | | This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
* gh-91248: Optimize PyFrame_GetVar() (#99252)Victor Stinner2022-11-131-95/+136
| | | | PyFrame_GetVar() no longer creates a temporary dictionary to get a variable.
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-111-868/+202
| | | | | The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057
* gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)Eric Snow2022-11-111-3/+2
| | | | | We also move the closely related max_module_number and add comments documenting the group of struct members. https://github.com/python/cpython/issues/81057
* gh-99300: Use Py_NewRef() in Objects/ directory (#99354)Victor Stinner2022-11-1013-128/+66
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
* gh-99300: Use Py_NewRef() in Objects/ directory (#99351)Victor Stinner2022-11-105-188/+100
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
* gh-99300: Use Py_NewRef() in Objects/ directory (#99335)Victor Stinner2022-11-108-244/+120
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
* gh-99300: Use Py_NewRef() in Objects/listobject.c (#99336)Victor Stinner2022-11-101-40/+20
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Objects/listobject.c.
* gh-99300: Use Py_NewRef() in Objects/dictobject.c (#99333)Victor Stinner2022-11-101-92/+48
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Objects/dictobject.c.
* gh-99300: Use Py_NewRef() in Objects/ directory (#99332)Victor Stinner2022-11-109-156/+77
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-104-23/+99
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-081-1/+1
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* gh-91248: Add PyFrame_GetVar() function (#95712)Victor Stinner2022-11-081-0/+30
| | | | | | Add PyFrame_GetVar() and PyFrame_GetVarString() functions to get a frame variable by its name. Move PyFrameObject C API tests from test_capi to test_frame.
* GH-93143: Don't turn LOAD_FAST into LOAD_FAST_CHECK (GH-99075)Brandt Bucher2022-11-081-44/+36
|
* gh-99181: fix except* on unhashable exceptions (GH-99192)Irit Katriel2022-11-081-17/+26
|
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-071-4/+4
|
* Correct some typos in comments (GH-98194)jonasdlindner2022-11-061-1/+1
| | | Automerge-Triggered-By: GH:AlexWaygood
* gh-98284: better error message for undefined abstractmethod (#97971)Kaushik Kulkarni2022-11-051-6/+13
|
* gh-90716: Fix pylong_int_from_string() refleak (#99094)Victor Stinner2022-11-041-0/+1
| | | | | | Fix validated by: $ ./python -m test -R 3:3 test_int Tests result: SUCCESS
* gh-90716: bugfixes and more tests for _pylong. (#99073)Gregory P. Smith2022-11-031-4/+11
| | | | | | | | | * Properly decref on _pylong import error. * Improve the error message on _pylong TypeError. * Fix the assertion error in pydebug builds to be a TypeError. * Tie the return value comments together. These are minor followups to issues not caught among the reviewers on https://github.com/python/cpython/pull/96673.
* GH-96793: Implement PEP 479 in bytecode. (GH-99006)Mark Shannon2022-11-031-19/+3
| | | | | * Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-023-13/+8
|
* gh-98852: Fix subscription of type aliases (GH-98920)Serhiy Storchaka2022-11-011-0/+7
| | | | | Fix subscription of type aliases containing bare generic types or types like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int], where A is a generic type, and T is a type variable.
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` ↵Nikita Sobolev2022-10-301-2/+2
| | | | (#98806)
* obmalloc: Remove unused variable. (GH-98770)Benjamin Peterson2022-10-271-3/+1
|