> >>> def f(x): > y = [i+i for i in x] > > >>> dis(f) > 2 0 BUILD_LIST 0 > 3 DUP_TOP > 4 LOAD_ATTR 0 (append) <-- delete this > line > 7 STORE_FAST 3 (_[1]) > 10 LOAD_FAST 0 (x) > 13 GET_ITER > >> 14 FOR_ITER 20 (to 37) > 17 STORE_FAST 2 (i) > 20 LOAD_FAST 3 (_[1]) > 23 LOAD_FAST 2 (i) > 26 LOAD_FAST 2 (i) > 29 BINARY_ADD > 30 CALL_FUNCTION 1 --> replace with > LIST_APPEND > 33 POP_TOP <-- delete this > line > 34 JUMP_ABSOLUTE 14 > >> 37 DELETE_FAST 3 (_[1]) P.S. The patch also removes the DELETE_FAST at position 37 > 40 STORE_FAST 1 (y) > 43 LOAD_CONST 0 (None) > 46 RETURN_VALUE Raymond Hettinger
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4