summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* GH-91095: Specialize calls to normal Python classes. (GH-99331)Mark Shannon2023-06-222-4/+23
|
* gh-105927: finalize_modules_clear_weaklist() uses _PyWeakref_GET_REF() (#105971)Victor Stinner2023-06-211-1/+1
| | | | | finalize_modules_clear_weaklist() now holds a strong reference to the module longer than before: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: type_from_ref() uses _PyWeakref_GET_REF() (#105963)Victor Stinner2023-06-211-13/+24
| | | | | type_from_ref() now returns a strong reference to the type, instead of a borrowed reference: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: Add PyWeakref_GetRef() function (#105932)Victor Stinner2023-06-211-0/+18
| | | | Add tests on PyWeakref_NewRef(), PyWeakref_GetObject(), PyWeakref_GET_OBJECT() and PyWeakref_GetRef().
* gh-105927: Add _PyWeakref_GET_REF() internal function (#105929)Victor Stinner2023-06-201-49/+43
| | | Add new pycore_weakref.h internal header file.
* gh-105927: Refactor weakrefobject.c (#105928)Victor Stinner2023-06-191-60/+56
| | | | | | * Rename proxy_checkref() to proxy_check_ref(). * proxy_check_ref() now checks the object, not the proxy. * Most functions take PyObject* instead of PyWeakReference*. * Remove redundant calls to PyWeakref_GET_OBJECT().
* GH-104584: Assorted fixes for the optimizer API. (GH-105683)Mark Shannon2023-06-191-4/+20
| | | | | | * Add test for long loops * Clear ENTER_EXECUTOR when deopting code objects.
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-144-97/+25
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)Petr Viktorin2023-06-121-1/+1
|
* gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (#105491)Erlend E. Aasland2023-06-111-12/+17
| | | Bail on first error to prevent exceptions from possibly being overwritten.
* Miscellaneous improvements to the typing docs (#105529)Alex Waygood2023-06-091-65/+80
| | | Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
* gh-100227: Lock Around Modification of the Global Allocators State (gh-105516)Eric Snow2023-06-081-52/+177
| | | The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
* gh-103906: Remove immortal refcounting in compile/marshal.c (gh-103922)Dong-hee Na2023-06-051-1/+1
|
* gh-98963: Restore the ability to have a dict-less property. (#105262)Gregory P. Smith2023-06-051-8/+37
| | | | | Ignore doc string assignment failures in `property` as has been the behavior of all past Python releases.
* gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)Eric Snow2023-06-022-2/+2
| | | The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-022-1/+8
|
* GH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)Mark Shannon2023-06-021-3/+15
|
* gh-85275: Remove old buffer APIs (#105137)Inada Naoki2023-06-021-9/+35
| | | | | They are now abi-only. Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-92536: Remove PyUnicode_READY() calls (#105210)Victor Stinner2023-06-017-50/+2
| | | | Since Python 3.12, PyUnicode_READY() does nothing and always returns 0.
* gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)Victor Stinner2023-06-0110-79/+10
| | | | | | Since Python 3.12, PyUnicode_READY() does nothing and always returns 0. Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).
* gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() ↵Eric Snow2023-06-011-16/+44
| | | | | | | (gh-105122) When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary). That led to problems for third-party static types. We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
* gh-105140: remove unused arg of _PyErr_ChainStackItem (#105141)Irit Katriel2023-06-011-1/+1
|
* gh-105107: Remove PyCFunction_Call() function (#105181)Victor Stinner2023-06-011-3/+3
| | | | | * Keep the function in the stable ABI. * Add unit tests on PyCFunction_Call() since it remains supported in the stable ABI.
* gh-105156: Cleanup usage of old Py_UNICODE type (#105158)Victor Stinner2023-06-011-1/+1
| | | | | | | | | | | | * refcounts.dat: * Remove Py_UNICODE functions. * Replace Py_UNICODE argument type with wchar_t. * _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecated in comments. It's no longer needed since they now use Py_UCS4 type, rather than the deprecated Py_UNICODE type. * gdb: Remove unused char_width() method.
* gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)Victor Stinner2023-06-011-4/+4
| | | | | | | | Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API: use wchar_t instead. Replace Py_UNICODE with wchar_t in multiple C files. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-105107: Remove PyEval_CallFunction() function (#105108)Victor Stinner2023-05-311-8/+7
| | | | | | | | | | | | | | Remove 4 functions from the C API, deprecated in Python 3.9: * PyEval_CallObjectWithKeywords() * PyEval_CallObject() * PyEval_CallFunction() * PyEval_CallMethod() Keep 3 functions in the stable ABI: * PyEval_CallObjectWithKeywords() * PyEval_CallFunction() * PyEval_CallMethod()
* gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)Inada Naoki2023-05-311-46/+21
|
* gh-105020: Share tp_bases and tp_mro Between Interpreters For All Static ↵Eric Snow2023-05-311-30/+46
| | | | | Builtin Types (gh-105115) In gh-103912 we added tp_bases and tp_mro to each PyInterpreterState.types.builtins entry. However, doing so ignored the fact that both PyTypeObject fields are public API, and not documented as internal (as opposed to tp_subclasses). We address that here by reverting back to shared objects, making them immortal in the process.
* gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* ↵Irit Katriel2023-05-301-0/+39
| | | | implementation in the unstable API (#105072)
* Fix compiler warning in unicodeobject.c (#105050)Inada Naoki2023-05-291-1/+1
|
* gh-103921: Document PEP 695 (#104642)Jelle Zijlstra2023-05-261-50/+65
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104955: Fix __release_buffer__ signature (#104956)Jelle Zijlstra2023-05-261-1/+1
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-89091: raise `RuntimeWarning` for unawaited async generator methods (#104611)Kumar Aditya2023-05-261-0/+26
|
* gh-104879: Fix TypeAliasType.__module__ in exec() (#104881)Jelle Zijlstra2023-05-241-2/+7
|
* gh-104770: Let generator.close() return value (#104771)Nicolas Tessore2023-05-231-3/+8
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-98836: Extend PyUnicode_FromFormat() (GH-98838)Serhiy Storchaka2023-05-211-108/+218
| | | | | | | | | * Support for conversion specifiers o (octal) and X (uppercase hexadecimal). * Support for length modifiers j (intmax_t) and t (ptrdiff_t). * Length modifiers are now applied to all integer conversions. * Support for wchar_t C strings (%ls and %lV). * Support for variable width and precision (*). * Support for flag - (left alignment).
* GH-101291: Add low level, unstable API for pylong (GH-101685)Mark Shannon2023-05-211-0/+14
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-104717: Add comment about manual loop unrolling (gh-104718)Dong-hee Na2023-05-211-0/+1
|
* gh-104600: Make type.__type_params__ writable (#104634)Jelle Zijlstra2023-05-191-13/+29
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104600: Make function.__type_params__ writable (#104601)Jelle Zijlstra2023-05-181-1/+16
|
* gh-104549: Set __module__ on TypeAliasType (#104550)Jelle Zijlstra2023-05-183-31/+62
|
* typing: Add more tests for TypeVar (#104571)Jelle Zijlstra2023-05-171-1/+1
| | | | | | | | During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple.
* GH-103906: Remove immortal refcounting in the interpreter (GH-103909)Brandt Bucher2023-05-161-7/+1
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-166-4/+2490
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104454: Fix refleak in AttributeError_reduce (#104455)Charles Machalow2023-05-131-1/+3
| | | | | * Fix the reference leak introduced by https://github.com/python/cpython/issues/103333 Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* GH-94841: Fix usage of Py_ALWAYS_INLINE (GH-104409)Brandt Bucher2023-05-121-1/+1
|
* gh-103333: Pickle the keyword attributes of AttributeError (#103352)Charles Machalow2023-05-121-1/+43
| | | | | | * Pickle the `name` and `args` attributes of AttributeError when present. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-104371: check return value of calling `mv.release` (#104417)Kumar Aditya2023-05-121-1/+7
|
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-121-3/+0
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* Fix refleak in `super_descr_get` (#104408)Brandt Bucher2023-05-121-1/+3
|