summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)Mark Shannon2022-10-271-2/+2
| | | | Change FOR_ITER to have the same stack effect regardless of whether it branches or not. Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
* gh-98627: Use a Switch in PyModule_FromDefAndSpec2() (gh-98734)Eric Snow2022-10-271-14/+18
| | | This helps simplify some changes in follow-up PRs. It also matches what we're doing in PyModule_ExecDef().
* gh-90716: add _pylong.py module (#96673)Neil Schemenauer2022-10-261-0/+170
| | | | | | | | | | | | Add Python implementations of certain longobject.c functions. These use asymptotically faster algorithms that can be used for operations on integers with many digits. In those cases, the performance overhead of the Python implementation is not significant since the asymptotic behavior is what dominates runtime. Functions provided by this module should be considered private and not part of any public API. Co-author: Tim Peters <tim.peters@gmail.com> Co-author: Mark Dickinson <dickinsm@gmail.com> Co-author: Bjorn Martinsson
* gh-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-251-4/+16
|
* gh-96143: Move the perf trampoline files to the Python directory (#98675)Pablo Galindo Salgado2022-10-252-559/+0
|
* gh-91051: allow setting a callback hook on PyType_Modified (GH-97875)Carl Meyer2022-10-211-3/+97
|
* gh-98421: Clean Up PyObject_Print (GH-98422)MonadChains2022-10-201-17/+8
| | | | | Work on test coverage for `PyObject_Print` made it clear that some lines can't get executed. Simplify the function by excluding the checks for non-string types. Also eliminate creating a temporary bytes object.
* gh-98417: Store int_max_str_digits on the Interpreter State (GH-98418)Eric Snow2022-10-191-3/+3
|
* gh-98393: os module reject bytes-like, only accept bytes (#98394)Victor Stinner2022-10-181-30/+8
| | | | | The os module and the PyUnicode_FSDecoder() function no longer accept bytes-like paths, like bytearray and memoryview types: only the exact bytes type is accepted for bytes strings.
* gh-97982: Factorize PyUnicode_Count() and unicode_count() code (#98025)Nikita Sobolev2022-10-121-60/+26
| | | | Add unicode_count_impl() to factorize PyUnicode_Count() and unicode_count() code.
* gh-97982: Remove asciilib_count() (#98164)Victor Stinner2022-10-112-15/+11
| | | | | asciilib_count() is the same than ucs1lib_count(): the code is not specialized for ASCII strings, so it's not worth it to have a separated function. Remove asciilib_count() function.
* gh-95756: Free and NULL-out code caches when needed (GH-98181)Ken Jin2022-10-112-0/+3
|
* gh-95756: Lazily created cached co_* attrs (GH-97791)Ken Jin2022-10-112-12/+72
|
* gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055)Carl Meyer2022-10-081-11/+30
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-071-15/+104
|
* gh-97943: PyFunction_GetAnnotations should return a borrowed reference. (#97949)larryhastings2022-10-061-2/+5
|
* gh-95196: Disable incorrect pickling of the C implemented classmethod ↵Serhiy Storchaka2022-10-051-1/+1
| | | | descriptors (GH-96383)
* GH-97779: Ensure that *all* frame objects are backed by "complete" frames ↵Brandt Bucher2022-10-052-4/+34
| | | | (GH-97845)
* gh-96526: Clarify format and __format__ docstrings (gh-96648)Michael2022-10-034-6/+13
|
* gh-96512: Move int_max_str_digits setting to PyConfig (#96944)Gregory P. Smith2022-10-031-7/+3
| | | | | | | | | | | It had to live as a global outside of PyConfig for stable ABI reasons in the pre-3.12 backports. This removes the `_Py_global_config_int_max_str_digits` and gets rid of the equivalent field in the internal `struct _is PyInterpreterState` as code can just use the existing nested config struct within that. Adds tests to verify unique settings and configs in subinterpreters.
* gh-94808: `_PyLineTable_StartsLine` was not used (GH-96609)Nikita Sobolev2022-10-031-27/+0
|