summaryrefslogtreecommitdiff
path: root/Lib/test/test_dis.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-03 20:29:11 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-03 20:29:11 +0000
commit37932a249957a12b3b7ee2e25c855d8aaf1e0235 (patch)
treef722870b3f5e1e7127d1da973fcf9ee0fa14cf69 /Lib/test/test_dis.py
parent4dffebed4c542c9302febf849eba4880ac132268 (diff)
downloadcpython-37932a249957a12b3b7ee2e25c855d8aaf1e0235.tar.gz
SF bug 1442442: LIST_APPEND optimization got lost in the AST merge.
Add it back.
Diffstat (limited to 'Lib/test/test_dis.py')
-rw-r--r--Lib/test/test_dis.py40
1 files changed, 19 insertions, 21 deletions
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index d8d53cd3b2..081941dafb 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -54,31 +54,29 @@ def bug1333982(x=[]):
dis_bug1333982 = """\
%-4d 0 LOAD_CONST 1 (0)
- 3 JUMP_IF_TRUE 47 (to 53)
+ 3 JUMP_IF_TRUE 41 (to 47)
6 POP_TOP
7 LOAD_GLOBAL 0 (AssertionError)
10 BUILD_LIST 0
13 DUP_TOP
- 14 LOAD_ATTR 1 (append)
- 17 STORE_FAST 1 (_[1])
- 20 LOAD_FAST 0 (x)
- 23 GET_ITER
- >> 24 FOR_ITER 16 (to 43)
- 27 STORE_FAST 2 (s)
- 30 LOAD_FAST 1 (_[1])
- 33 LOAD_FAST 2 (s)
- 36 CALL_FUNCTION 1
- 39 POP_TOP
- 40 JUMP_ABSOLUTE 24
- >> 43 DELETE_FAST 1 (_[1])
-
- %-4d 46 LOAD_CONST 2 (1)
- 49 BINARY_ADD
- 50 RAISE_VARARGS 2
- >> 53 POP_TOP
-
- %-4d 54 LOAD_CONST 0 (None)
- 57 RETURN_VALUE
+ 14 STORE_FAST 1 (_[1])
+ 17 LOAD_FAST 0 (x)
+ 20 GET_ITER
+ >> 21 FOR_ITER 13 (to 37)
+ 24 STORE_FAST 2 (s)
+ 27 LOAD_FAST 1 (_[1])
+ 30 LOAD_FAST 2 (s)
+ 33 LIST_APPEND
+ 34 JUMP_ABSOLUTE 21
+ >> 37 DELETE_FAST 1 (_[1])
+
+ %-4d 40 LOAD_CONST 2 (1)
+ 43 BINARY_ADD
+ 44 RAISE_VARARGS 2
+ >> 47 POP_TOP
+
+ %-4d 48 LOAD_CONST 0 (None)
+ 51 RETURN_VALUE
"""%(bug1333982.func_code.co_firstlineno + 1,
bug1333982.func_code.co_firstlineno + 2,
bug1333982.func_code.co_firstlineno + 3)