python Programming Glossary: store_name
Why does Python code run faster in a function? http://stackoverflow.com/questions/11241523/why-does-python-code-run-faster-in-a-function 9 CALL_FUNCTION 1 12 GET_ITER 13 FOR_ITER 6 to 22 16 STORE_NAME 1 i 2 19 JUMP_ABSOLUTE 13 22 POP_BLOCK 23 LOAD_CONST 2 None.. The difference is that STORE_FAST is faster than STORE_NAME . This is because in a function i is a local but at toplevel..
Accessing class variables from a list comprehension in the class definition http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition 0 __locals__ 3 STORE_LOCALS 4 LOAD_NAME 0 __name__ 7 STORE_NAME 1 __module__ 10 LOAD_CONST 0 'foo. locals .Foo' 13 STORE_NAME.. 1 __module__ 10 LOAD_CONST 0 'foo. locals .Foo' 13 STORE_NAME 2 __qualname__ 3 16 LOAD_CONST 1 5 19 STORE_NAME 3 x 4 22 LOAD_CONST.. 13 STORE_NAME 2 __qualname__ 3 16 LOAD_CONST 1 5 19 STORE_NAME 3 x 4 22 LOAD_CONST 2 code object listcomp at 0x10a385420 file..
In Python, what is the difference between “.append()” and “+= []”? http://stackoverflow.com/questions/725782/in-python-what-is-the-difference-between-append-and compile s s.append 'spam' '' 'exec' 1 0 BUILD_LIST 0 3 STORE_NAME 0 s 6 LOAD_NAME 0 s 9 LOAD_ATTR 1 append 12 LOAD_CONST 0 'spam'.. dis.dis compile s s 'spam' '' 'exec' 1 0 BUILD_LIST 0 3 STORE_NAME 0 s 6 LOAD_NAME 0 s 9 LOAD_CONST 0 'spam' 12 BUILD_LIST 1.. s 9 LOAD_CONST 0 'spam' 12 BUILD_LIST 1 15 INPLACE_ADD 16 STORE_NAME 0 s 19 LOAD_CONST 1 None 22 RETURN_VALUE We can improve performance..
Why is looping over range() in Python faster than using a while loop? http://stackoverflow.com/questions/869229/why-is-looping-over-range-in-python-faster-than-using-a-while-loop a more concrete idea use while loop 1 0 LOAD_CONST 0 0 3 STORE_NAME 0 i 2 6 SETUP_LOOP 28 to 37 9 LOAD_NAME 0 i # 12 LOAD_CONST.. LOAD_NAME 0 i # 25 LOAD_CONST 2 1 # 28 INPLACE_ADD # 29 STORE_NAME 0 i # 32 JUMP_ABSOLUTE 9 # 35 POP_TOP 36 POP_BLOCK The loop.. 12 CALL_FUNCTION 2 15 GET_ITER 16 FOR_ITER 6 to 25 # 19 STORE_NAME 1 n # 2 22 JUMP_ABSOLUTE 16 # 25 POP_BLOCK 26 LOAD_CONST 2 None..
|