mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. (GH-23743)
This commit is contained in:
parent
6f79e60b66
commit
8473cf89bd
8 changed files with 3504 additions and 3563 deletions
|
@ -53,9 +53,8 @@ basic.events = [(0, 'call'),
|
|||
# following that clause?
|
||||
|
||||
|
||||
# Some constructs like "while 0:", "if 0:" or "if 1:...else:..." are optimized
|
||||
# away. No code # exists for them, so the line numbers skip directly from
|
||||
# "del x" to "x = 1".
|
||||
# Some constructs like "while 0:", "if 0:" or "if 1:...else:..." could be optimized
|
||||
# away. Make sure that those lines aren't skipped.
|
||||
def arigo_example0():
|
||||
x = 1
|
||||
del x
|
||||
|
@ -66,6 +65,7 @@ def arigo_example0():
|
|||
arigo_example0.events = [(0, 'call'),
|
||||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(3, 'line'),
|
||||
(5, 'line'),
|
||||
(5, 'return')]
|
||||
|
||||
|
@ -79,6 +79,7 @@ def arigo_example1():
|
|||
arigo_example1.events = [(0, 'call'),
|
||||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(3, 'line'),
|
||||
(5, 'line'),
|
||||
(5, 'return')]
|
||||
|
||||
|
@ -94,6 +95,7 @@ def arigo_example2():
|
|||
arigo_example2.events = [(0, 'call'),
|
||||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(3, 'line'),
|
||||
(4, 'line'),
|
||||
(7, 'line'),
|
||||
(7, 'return')]
|
||||
|
@ -236,9 +238,13 @@ tightloop_example.events = [(0, 'call'),
|
|||
(1, 'line'),
|
||||
(2, 'line'),
|
||||
(3, 'line'),
|
||||
(4, 'line'),
|
||||
(5, 'line'),
|
||||
(4, 'line'),
|
||||
(5, 'line'),
|
||||
(4, 'line'),
|
||||
(5, 'line'),
|
||||
(4, 'line'),
|
||||
(5, 'line'),
|
||||
(5, 'exception'),
|
||||
(6, 'line'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue