aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAge
* gh-71339: Use new assertion methods in tests (GH-129046)Serhiy Storchaka2025-05-22
|
* gh-127146: xfail more Emscripten stack overflows (#134358)Hood Chatham2025-05-20
| | | Adds some additional test xfails for Emscripten stack overflows. Also corrects a test skip for test_io.
* gh-130070: Fix `exec(<string>, closure=<non-None>)` unexpected path (#130071)Bartosz Sławecki2025-04-17
| | | | | | Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled) for `exec` when the `source` argument is a string and the `closure` argument is not `None`. Co-authored-by: sobolevn <mail@sobolevn.me>
* gh-131738: optimize builtin any/all/tuple calls with a generator expression ↵Irit Katriel2025-03-28
| | | | arg (#131737)
* gh-131586: Avoid refcount contention in some "special" calls (#131588)Sam Gross2025-03-26
| | | | | | | | | | In the free threaded build, the `_PyObject_LookupSpecial()` call can lead to reference count contention on the returned function object becuase it doesn't use stackrefs. Refactor some of the callers to use `_PyObject_MaybeCallSpecialNoArgs`, which uses stackrefs internally. This fixes the scaling bottleneck in the "lookup_special" microbenchmark in `ftscalingbench.py`. However, the are still some uses of `_PyObject_LookupSpecial()` that need to be addressed in future PRs.
* gh-126835: Move constant tuple folding from ast_opt to CFG (#130769)Yan Yanchii2025-03-19
|
* gh-131277: allow `EnvironmentVarGuard` to unset more than one environment ↵Bénédikt Tran2025-03-16
| | | | | variable at once (#131280) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-131152: Remove unused imports from tests (#131153)Victor Stinner2025-03-13
|
* GH-127705: Use `_PyStackRef`s in the default build. (GH-127875)Mark Shannon2025-03-10
|
* gh-130163: Fix crashes related to PySys_GetObject() (GH-130503)Serhiy Storchaka2025-02-25
| | | | | | | | The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().
* GH-130396: Use computed stack limits on linux (GH-130398)Mark Shannon2025-02-25
| | | | | | | | | | | * Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
* gh-126835: Move constant unaryop & binop folding to CFG (#129550)Yan Yanchii2025-02-21
|
* gh-71339: Fix an order-dependent failure in test_unittest (GH-129133)Serhiy Storchaka2025-01-21
| | | It failed if it was preceded by test_builtin.
* gh-128438: Use `EnvironmentVarGuard` for `test_{builtin,io,locale}.py` (#128476)Yan Yanchii2025-01-15
| | | | | Modifying locale-related environment variables in `Lib/test/test_builtin.py`, `Lib/test/test_io.py` and `Lib/test/test_locale.py` is now achieved by using an `EnvironmentVarGuard` context instead of an explicit `try-finally` block.
* gh-128404: Remove ``asyncio`` from ``test_builtin`` (#128403)Thomas Grainger2025-01-02
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-128058: Fix test_builtin ImmortalTests (#128068)Victor Stinner2024-12-20
| | | | | | On 32-bit Free Threading systems, immortal reference count is 5 << 28, instead of 7 << 28. Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)Kumar Aditya2024-12-18
| | | | First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
* GH-125174: Mark objects as statically allocated. (#127797)Mark Shannon2024-12-11
| | | | | * Set a bit in the unused part of the refcount on 64 bit machines and the free-threaded build. * Use the top of the refcount range on 32 bit machines
* gh-69639: Add mixed-mode rules for complex arithmetic (C-like) (GH-124829)Sergey B Kirpichev2024-11-26
| | | | | | | | | | | | | | | "Generally, mixed-mode arithmetic combining real and complex variables should be performed directly, not by first coercing the real to complex, lest the sign of zero be rendered uninformative; the same goes for combinations of pure imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for complex elementary functions. This patch implements mixed-mode arithmetic rules, combining real and complex variables as specified by C standards since C99 (in particular, there is no special version for the true division with real lhs operand). Most C compilers implementing C99+ Annex G have only these special rules (without support for imaginary type, which is going to be deprecated in C2y).
* gh-119793: Add optional length-checking to `map()` (GH-120471)Nice Zombies2024-11-04
| | | | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* GH-125174: Make immortal objects more robust, following design from PEP 683 ↵Mark Shannon2024-10-10
| | | | (GH-125251)
* gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in ↵Serhiy Storchaka2024-09-28
| | | | | | | | | | | | | classes (GH-123613) * Setting the __module__ attribute for a class now removes the __firstlineno__ item from the type's dict. * The _collections_abc and _pydecimal modules now completely replace the collections.abc and decimal modules after importing them. This allows to get the source of classes and functions defined in these modules. * inspect.findsource() now checks whether the first line number for a class is out of bound.
* gh-116402: Avoid readline in test_builtin TTY input tests (GH-122447)Łukasz Langa2024-07-30
|
* gh-122234: fix accuracy issues for sum() (#122236)Sergey B Kirpichev2024-07-29
| | | | | | | | * Use compensated summation for complex sums with floating-point items. This amends #121176. * sum() specializations for floats and complexes now use PyLong_AsDouble() instead of PyLong_AsLongAndOverflow() and compensated summation as well.
* gh-121637: Syntax error for optimized-away incorrect await (#121656)Jelle Zijlstra2024-07-22
| | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-121149: improve accuracy of builtin sum() for complex inputs (gh-121176)Sergey B Kirpichev2024-07-05
|
* gh-119057: Use better error messages for zero division (#119066)Nikita Sobolev2024-06-03
|
* gh-118899: Add tests for `NotImplemented` attribute access (#118902)Nikita Sobolev2024-05-12
|
* gh-118767: Improve tests and docs for bool(NotImplemented) (#118813)Jelle Zijlstra2024-05-09
|
* gh-118767: Make bool(NotImplemented) raise TypeError (#118775)Jelle Zijlstra2024-05-08
|
* gh-105879: Add support for keyword arguments to eval and exec (#105885)Raphael Gaschignard2024-05-02
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-76763: Make chr() always raising ValueError for out-of-range values ↵Serhiy Storchaka2024-02-10
| | | | | | (GH-114882) Previously it raised OverflowError for very large or very small values.
* gh-114552: Update `__dir__` method docs: it allows returning an iterable ↵Nikita Sobolev2024-02-10
| | | | (#114662)
* gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (#113897)Kirill Podoprigora2024-01-11
| | | | | Fix DeprecationWarning in test___ne__(). Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770)Serhiy Storchaka2023-12-14
| | | | | | It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
* gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False ↵andrewluotechnologies2023-12-07
| | | | (#112504)
* gh-74616: Raise ValueError in case of null character in input prompt (GH-1738)Kushal Das2023-12-07
| | | | | | | If the input prompt to the builtin input function on terminal has any null character, then raise ValueError instead of silently truncating it. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-112625: Protect bytearray from being freed by misbehaving iterator inside ↵chilaxan2023-12-04
| | | | bytearray.join (GH-112626)
* gh-110393: Remove watchdog with hardcoded timeout (#110400)Victor Stinner2023-10-05
| | | | | | | | test_builtin and test_socketserver no longer use signal.alarm() to implement a watchdog with a hardcoded timeout (2 and 60 seconds). Python test runner regrtest has two watchdogs: faulthandler and timeout on running worker processes. Tests using short hardcoded timeout can fail on slowest buildbots just because the timeout is too short.
* gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)Serhiy Storchaka2023-09-02
| | | | Only mark tests which spend significant system or user time, by itself or in subprocesses.
* gh-108113: Make it possible to optimize an AST (#108282)Irit Katriel2023-08-23
|
* gh-108113: Make it possible to create an optimized AST (#108154)Irit Katriel2023-08-21
|
* gh-81005: Refactor str tests to reflect that str and unicode are merged in ↵Daniel Fortunov2023-05-23
| | | | | | Python 3 (#13172) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-104600: Make type.__type_params__ writable (#104634)Jelle Zijlstra2023-05-19
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)Brandt Bucher2023-05-04
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-22
| | | | | | | | | This is the implementation of PEP683 Motivation: The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime. Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
* gh-102356: Add thrashcan macros to filter object dealloc (#102426)Marta Gómez Macías2023-03-05
| | | Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters.
* GH-90829: Fix empty iterable error message in min/max (#31181)Nnarol2023-01-08
|
* GH-100425: Improve accuracy of builtin sum() for float inputs (GH-100426)Raymond Hettinger2022-12-23
|
* gh-99124: use concrete exception types in `test_builtin` (#99125)Nikita Sobolev2022-11-07
|