summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-127146: Emscripten: Skip segfaults in test suite (#127151)Hood Chatham2024-12-051-0/+2
| | | | Added skips for tests known to cause problems when running on Emscripten. These mostly relate to the limited stack depth on Emscripten.
* gh-126072: Set docstring attribute for module and class (#126231)Xuanteng Huang2024-11-081-4/+12
|
* gh-126298: Don't deduplicate slice constants based on equality (#126398)Michael Droettboom2024-11-071-19/+59
| | | | | | | | | | | | | | | * gh-126298: Don't deduplicated slice constants based on equality * NULL check for PySlice_New * Fix refcounting * Fix refcounting some more * Fix refcounting * Make tests more complete * Fix tests
* gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)Xuanteng Huang2024-10-301-4/+4
|
* GH-125837: Split `LOAD_CONST` into three. (GH-125972)Mark Shannon2024-10-291-20/+18
| | | | | | | | * Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
* gh-125063: Emit slices as constants in the bytecode compiler (#125064)Michael Droettboom2024-10-081-2/+25
| | | | | | | | | | | | | | | | | | | | | | | * Make slices marshallable * Emit slices as constants * Update Python/marshal.c Co-authored-by: Peter Bierma <zintensitydev@gmail.com> * Refactor codegen_slice into two functions so it always has the same net effect * Fix for free-threaded builds * Simplify marshal loading of slices * Only return SUCCESS/ERROR from codegen_slice --------- Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)Irit Katriel2024-10-041-0/+13
|
* gh-115142: Skip some test cases in ``Lib/test/test_compile`` if ↵Kirill Podoprigora2024-09-301-1/+6
| | | | | | ``_testinternalcapi`` is not available (#124474) * Skip some test cases if "_testinternalcapi" is not available and if the test suite is running on another implementation than CPython.
* gh-124442: make `__static_attributes__` deterministic by sorting (#124492)Kira2024-09-281-0/+17
| | | | | Signed-off-by: kp2pml30 <kp2pml30@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-251-0/+39
| | | | of a boolean expression (#124394)
* gh-124022: Fix bug where class docstring is removed in interactive mode ↵Irit Katriel2024-09-131-6/+29
| | | | | | | (#124023) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-123958: apply docstring removal optimization in ast_opt instead of ↵Irit Katriel2024-09-111-0/+6
| | | | codegen (#123959)
* gh-123942: add missing test for docstring-handling code in ast_opt.c (#123943)Irit Katriel2024-09-111-0/+26
|
* gh-123142: Fix too wide source locations in tracebacks of exceptions from ↵Irit Katriel2024-08-211-2/+2
| | | | broken iterables in comprehensions (#123173)
* gh-122445: populate only modified fields in __static_attributes__ (#122446)Irit Katriel2024-08-021-1/+4
|
* gh-98442: fix locations of with statement's cleanup instructions (#120763)Irit Katriel2024-06-201-0/+33
| | | gh-98442: fix location of with statement's cleanup instructions
* gh-120722: Set position on RETURN_VALUE in lambda (#120724)Jelle Zijlstra2024-06-191-1/+28
|
* gh-120367: fix bug where compiler detects redundant jump after pseudo op ↵Irit Katriel2024-06-181-1/+26
| | | | replacement (#120714)
* gh-120417: Add #noqa: F401 to tests (#120627)Victor Stinner2024-06-181-2/+2
| | | | Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
* gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold ↵Irit Katriel2024-06-171-0/+27
| | | | blocks (#120425)
* gh-120225: fix crash in compiler on empty block at end of exception handler ↵Irit Katriel2024-06-071-0/+10
| | | | (#120235)
* gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)Jelle Zijlstra2024-05-221-1/+1
| | | | | | | | | | The PEP 649 implementation will require a way to load NotImplementedError from the bytecode. @markshannon suggested implementing this by converting LOAD_ASSERTION_ERROR into a more general mechanism for loading constants. This PR adds this new opcode. I will work on the rest of the implementation of the PEP separately. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-118465: Add __firstlineno__ attribute to class (GH-118475)Serhiy Storchaka2024-05-061-1/+4
| | | | It is set by compiler with the line number of the first line of the class definition.
* gh-117680: make _PyInstructionSequence a PyObject and use it in tests (#117629)Irit Katriel2024-04-171-0/+46
|
* gh-116303: Skip tests if C recursion limit is unavailable (GH-117368)Erlend E. Aasland2024-04-081-5/+6
| | | | | The test suite fetches the C recursion limit from the _testcapi extension module. Test extension modules can be disabled using the --disable-test-modules configure option.
* gh-115775: Compiler adds __static_attributes__ field to classes (#115913)Irit Katriel2024-03-261-0/+58
|
* gh-116100: Add `test` arg to `ast.If` and `op` arg to `ast.BoolOp` calls ↵Kirill Podoprigora2024-02-291-2/+2
| | | | (#116101)
* Fix test_compile with -O mode (GH-115346)Serhiy Storchaka2024-02-191-2/+5
|
* gh-115347: avoid emitting redundant NOP for the docstring with -OO (#115494)Irit Katriel2024-02-151-0/+26
|
* gh-107901: make compiler inline basic blocks with no line number and no ↵Irit Katriel2024-02-021-12/+50
| | | | fallthrough (#114750)
* gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG ↵Irit Katriel2024-01-221-3/+11
| | | | before optimize_basic_block. (#114408)
* GH-113655: Lower the C recursion limit on various platforms (GH-113944)Mark Shannon2024-01-161-5/+3
|
* gh-107901: duplicate blocks with no lineno that have an eval break and ↵Irit Katriel2024-01-121-0/+15
| | | | multiple predecessors (#113950)
* gh-113932: assert ``SyntaxWarning`` in test_compile.TestSpecifics.test_… ↵Kirill Podoprigora2024-01-111-1/+2
| | | | (#113933)
* gh-113603: Compiler no longer tries to maintain the no-empty-block invariant ↵Irit Katriel2024-01-031-0/+13
| | | | (#113636)
* gh-113054: Compiler no longer replaces a redundant jump with no line number ↵Irit Katriel2023-12-191-0/+4
| | | | by a NOP (#113139)
* gh-112962: in dis module, put cache information in the Instruction instead ↵Irit Katriel2023-12-131-2/+3
| | | | of creating fake Instructions to represent it (#113016)
* gh-111123: symtable should visit exception handlers before the else block ↵Irit Katriel2023-10-211-0/+17
| | | | (#111142)
* gh-109889: fix compiler's redundant NOP detection to look past NOPs with no ↵Irit Katriel2023-09-281-0/+5
| | | | lineno when looking for the next instruction's lineno (#109987)
* gh-109823: Adjust labels in compiler when removing an empty basic block ↵Irit Katriel2023-09-251-0/+5
| | | | which is a jump target (#109839)
* gh-109719: Fix missing jump target labels when compiler reorders cold/warm ↵Irit Katriel2023-09-221-0/+11
| | | | blocks (#109734)
* gh-109627: duplicated smalll exit blocks need to be assigned jump target ↵Irit Katriel2023-09-201-0/+9
| | | | labels (#109630)
* gh-109341: Fix crash on compiling invalid AST including TypeAlias (#109349)Jelle Zijlstra2023-09-131-0/+20
|
* gh-109351: Fix crash when compiling AST with invalid NamedExpr (#109352)Jelle Zijlstra2023-09-131-0/+27
|
* gh-109195: fix source location for super load before LOAD_SUPER_ATTR (#109289)Carl Meyer2023-09-111-0/+7
|
* GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)Victor Stinner2023-09-081-6/+6
| | | | | | | Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
* 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-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop ↵Irit Katriel2023-08-211-0/+14
| | | | (#108242)
* gh-105724: Add location information to `assert` errors (GH-105935)Nikita Sobolev2023-08-161-5/+5
|
* GH-107263: Increase C stack limit for most functions, except ↵Mark Shannon2023-08-041-13/+8
| | | | | | `_PyEval_EvalFrameDefault()` (GH-107535) * Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.