summaryrefslogtreecommitdiff
path: root/Lib/test/test_dis.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-71/+70
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* Fix handling of line numbers around finally-blocks. (#17737)Mark Shannon2019-12-301-0/+66
|
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-33/+54
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* bpo-18578: Rename and document test.bytecode_helper as ↵Joannah Nanjekye2019-09-121-1/+1
| | | | | test.support.bytecode_helper (GH-15168) Rename and document test.bytecode_helper as test.support.bytecode_helper
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-251-1/+1
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-4/+4
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-37122: Make co->co_argcount represent the total number of positonal ↵Pablo Galindo2019-06-011-1/+1
| | | | arguments in the code object (GH-13726)
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-27/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-12458: Fix line numbers for multiline expressions. (GH-8774)Serhiy Storchaka2018-09-171-2/+6
|
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-2/+1
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937)Serhiy Storchaka2018-03-111-4/+4
|
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-124/+123
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon2018-01-291-17/+21
|
* bpo-24340: Fix estimation of the code stack size. (#5076)Serhiy Storchaka2018-01-091-8/+8
|
* bpo-31183: `dis` now handles coroutines & async generators (GH-3077)syncosmic2017-08-181-5/+27
| | | | | | | | | | | | | | Coroutines and async generators use a distinct attribute name for their code objects, so this updates the `dis` module to correctly disassemble objects with those attributes. Due to the increase in the test module length, it also fixes some latent defects in the tests related to how the displayed source line numbers are extracted. https://bugs.python.org/issue31230 is a follow-up issue suggesting we may want to solve this a different way, by instead giving all these object types a common `__code__` attribute, avoiding the need for special casing in the `dis` module.
* bpo-11822: Improve disassembly to show embedded code objects. (#1844)Serhiy Storchaka2017-06-111-7/+82
| | | The depth argument limits recursion.
* bpo-22352: Adjust widths in the output of dis.dis() for large line numbers ↵Serhiy Storchaka2017-04-191-1/+51
| | | | | | | and (#1153) instruction offsets. Add tests for widths of opcode names.
* Remove unused imports.Serhiy Storchaka2016-12-161-1/+0
|
* Issue #28317: The disassembler now decodes FORMAT_VALUE argument.Serhiy Storchaka2016-10-081-0/+24
|
* Rework CALL_FUNCTION* opcodesVictor Stinner2016-09-091-18/+18
| | | | | | | | | | | | | | | | | | | Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-081-1/+1
|
* Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-081-0/+33
| | | | Patch by Ivan Levkivskyi.
* Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.Serhiy Storchaka2016-06-121-41/+39
| | | | Patch by Demur Rumed.
* Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.Serhiy Storchaka2016-05-241-262/+262
| | | | Patch by Demur Rumed.
* Issue #26733: Disassembling a class now disassembles class and static methods.Serhiy Storchaka2016-04-231-2/+50
| | | | Patch by Xiang Zhang.
* Issue #26733: Fixed formatting line numbers in test_dis.Serhiy Storchaka2016-04-121-11/+11
| | | | Based on patch by Xiang Zhang.
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-111-13/+33
|
* Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-1/+1
| | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* merge 3.4 (#23048)Benjamin Peterson2014-12-131-3/+4
|\
| * pop the loop block even for infinite while loops (closes #23048)Benjamin Peterson2014-12-131-3/+4
| |
* | Closes #11471: avoid generating a JUMP_FORWARD instruction at the end of an ↵Antoine Pitrou2014-09-181-88/+84
| | | | | | | | | | | | if-block if there is no else-clause. Original patch by Eugene Toder.
* | Issue #21947: handle generator-iterator objects in disNick Coghlan2014-07-251-0/+8
|/ | | | Patch by Clement Rouault.
* Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had beenZachary Ware2013-12-261-34/+31
|\ | | | | | | disabled since 3.0 due to the changes in listcomp handling.
| * Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had beenZachary Ware2013-12-261-33/+30
| | | | | | | | disabled since 3.0 due to the changes in listcomp handling.
* | Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-6/+8
|\ \ | |/
| * Normalize whitespaceZachary Ware2013-12-081-1/+1
| |
| * Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-6/+8
| |
* | Close #17916: dis.Bytecode based replacement for distbNick Coghlan2013-11-231-0/+66
| | | | | | | | | | | | | | - Bytecode.from_traceback() alternate constructor - current_offset parameter and attribute Patch by Claudiu Popa
* | Remove incorrect comment from dis testsNick Coghlan2013-11-061-1/+0
| |
* | Close #19378: address flaws in the new dis module APIsNick Coghlan2013-11-061-44/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - confusing line_offset parameter -> first_line parameter - systematically test and fix new file parameter - remove redundant Bytecode.show_info() API - rename Bytecode.display_code() to Bytecode.dis() and have it return the multi-line string rather than printing it directly - eliminated some not-so-helpful helpers from the bytecode_helper test support module Also fixed a longstanding defect (worked around in the test suite) where lines emitted by the dis module could include trailing white space. That no longer happens, allowing the formatting tests to be simplified to use plain string comparisons.
* | merge 3.3 (#19117)Benjamin Peterson2013-09-291-4/+0
|\ \ | |/
| * fix duplicate test names in test_dis (closes #19117)Benjamin Peterson2013-09-291-4/+0
| |
* | Issue #11816: multiple improvements to the dis moduleNick Coghlan2013-05-061-33/+306
|/ | | | | | | | * get_instructions generator * ability to redirect output to a file * Bytecode and Instruction abstractions Patch by Nick Coghlan, Ryan Kelly and Thomas Kluyver.
* Issue #11823: disassembly now shows argument counts on calls with keyword argsAlexander Belopolsky2012-06-071-3/+3
|
* Merge 3.2: Issue #13703 plus some related test suite fixes.Georg Brandl2012-02-211-12/+13
|\
| * Another test_dis dict order dependency.Georg Brandl2012-02-201-6/+6
| |
| * Fix test_dis dependency on dict order.Georg Brandl2012-02-201-6/+7
| |
* | PEP 3155 / issue #13448: Qualified name for classes and functions.Antoine Pitrou2011-11-251-0/+1
| |
* | excise the remains of STOP_CODE, which hasn't done anything useful for yearsBenjamin Peterson2011-07-171-1/+1
| |
* | PyErr_Print can leave sys.last_traceback hanging around; kill itBenjamin Peterson2011-03-151-10/+8
| |