summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-128404: Remove ``asyncio`` from ``test_builtin`` (#128403)Thomas Grainger2025-01-021-59/+64
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-128058: Fix test_builtin ImmortalTests (#128068)Victor Stinner2024-12-201-1/+4
| | | | | | 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-181-2/+2
| | | | 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-111-1/+1
| | | | | * 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-261-1/+13
| | | | | | | | | | | | | | | "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-041-0/+105
| | | | | | 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-101-2/+2
| | | | (GH-125251)
* gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in ↵Serhiy Storchaka2024-09-281-0/+12
| | | | | | | | | | | | | 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-301-15/+24
|
* gh-122234: fix accuracy issues for sum() (#122236)Sergey B Kirpichev2024-07-291-0/+5
| | | | | | | | * 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-221-25/+45
| | | 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-051-0/+9
|
* gh-119057: Use better error messages for zero division (#119066)Nikita Sobolev2024-06-031-0/+10
|
* gh-118899: Add tests for `NotImplemented` attribute access (#118902)Nikita Sobolev2024-05-121-0/+18
|
* gh-118767: Improve tests and docs for bool(NotImplemented) (#118813)Jelle Zijlstra2024-05-091-6/+8
|
* gh-118767: Make bool(NotImplemented) raise TypeError (#118775)Jelle Zijlstra2024-05-081-7/+4
|
* gh-105879: Add support for keyword arguments to eval and exec (#105885)Raphael Gaschignard2024-05-021-0/+20
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-76763: Make chr() always raising ValueError for out-of-range values ↵Serhiy Storchaka2024-02-101-4/+7
| | | | | | (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-101-0/+8
| | | | (#114662)
* gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (#113897)Kirill Podoprigora2024-01-101-2/+2
| | | | | 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-141-0/+26
| | | | | | 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-071-0/+5
| | | | (#112504)
* gh-74616: Raise ValueError in case of null character in input prompt (GH-1738)Kushal Das2023-12-071-9/+35
| | | | | | | 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-041-0/+17
| | | | bytearray.join (GH-112626)
* gh-110393: Remove watchdog with hardcoded timeout (#110400)Victor Stinner2023-10-051-2/+0
| | | | | | | | 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-021-0/+1
| | | | 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-231-5/+7
|
* gh-108113: Make it possible to create an optimized AST (#108154)Irit Katriel2023-08-211-9/+32
|
* gh-81005: Refactor str tests to reflect that str and unicode are merged in ↵Daniel Fortunov2023-05-231-1/+1
| | | | | | 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-191-0/+12
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)Brandt Bucher2023-05-051-18/+25
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-221-1/+23
| | | | | | | | | 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-051-0/+10
| | | 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-081-2/+10
|
* GH-100425: Improve accuracy of builtin sum() for float inputs (GH-100426)Raymond Hettinger2022-12-231-0/+18
|
* gh-99124: use concrete exception types in `test_builtin` (#99125)Nikita Sobolev2022-11-081-3/+3
|
* gh-94808: Cover `LOAD_GLOBAL` for custom dict subtypes (GH-96767)Nikita Sobolev2022-11-041-0/+31
|
* gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)Pablo Galindo Salgado2022-09-271-2/+1
|
* gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198)Jeong YunWon2022-08-231-0/+5
|
* GH-94808: Test __build_class__ inside non-dict __builtins__ (GH-95932)Michael Droettboom2022-08-151-5/+9
|
* gh-93124: Fix typos in comments (GH-93125)Akuli2022-05-251-1/+1
| | | | | Fixes #93124 Automerge-Triggered-By: GH:rhettinger
* gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)Christian Heimes2022-05-131-1/+4
|
* gh-92203: Add closure support to exec(). (#92204)larryhastings2022-05-061-1/+79
| | | Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
* gh-91156: Use `locale.getencoding()` instead of getpreferredencoding (GH-91732)Inada Naoki2022-04-221-1/+1
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40280: Address more test failures on Emscripten (GH-31050)Christian Heimes2022-02-051-0/+2
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)Géry Ogam2022-01-181-4/+14
| | | | | | Use common error message for non-string attribute name in the builtin functions getattr and hasattr. The special check no longer needed since Python 3.0.
* bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)Irit Katriel2022-01-181-2/+2
|
* bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631)Victor Stinner2022-01-171-2/+14
| | | | | | | | | | Skip test_builtin PTY tests on non-ASCII characters if the readline module is loaded. The readline module changes input() behavior, but test_builtin is not intented to test the readline module. When the readline module is loaded, PyOS_Readline() uses the readline implementation. In some cases, the Python readline callback rlhandler() is called by readline with a string without non-ASCII characters.
* bpo-45346: Keep docs consistent regarding true and false values (GH-28697)Raymond Hettinger2021-10-021-1/+1
|
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142)Inada Naoki2021-04-021-6/+8
| | | | | | | | | | | | | * test__xxsubinterpreters * test_builtin * test_doctest * test_exceptions * test_opcodes * test_support * test_argparse * test_baseexception * test_bdb * test_bool * test_asdl_parser