¡@

Home 

python Programming Glossary: for_iter

Why does Python code run faster in a function?

http://stackoverflow.com/questions/11241523/why-does-python-code-run-faster-in-a-function

LOAD_CONST 3 100000000 9 CALL_FUNCTION 1 12 GET_ITER 13 FOR_ITER 6 to 22 16 STORE_FAST 0 i 3 19 JUMP_ABSOLUTE 13 22 POP_BLOCK.. LOAD_CONST 3 100000000 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..

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

range 18 LOAD_CONST 1 1 21 CALL_FUNCTION 1 24 GET_ITER 25 FOR_ITER 12 to 40 28 STORE_NAME 4 i 31 LOAD_NAME 2 x 34 LIST_APPEND 2.. 44 RETURN_VALUE No code object is loaded instead a FOR_ITER loop is run inline. So in Python 3.x the list generator was.. 1 .co_consts 2 4 0 BUILD_LIST 0 3 LOAD_FAST 0 .0 6 FOR_ITER 12 to 21 9 STORE_FAST 1 i 12 LOAD_GLOBAL 0 x 15 LIST_APPEND..

Python: generator expression vs. yield

http://stackoverflow.com/questions/1995418/python-generator-expression-vs-yield

three extra instructions in the setup but from the first FOR_ITER they differ in only one respect the yield approach uses a LOAD_FAST.. xrange 6 LOAD_FAST 0 x 9 CALL_FUNCTION 1 12 GET_ITER 13 FOR_ITER 40 to 56 16 STORE_FAST 2 i 3 19 SETUP_LOOP 31 to 53 22 LOAD_GLOBAL.. xrange 25 LOAD_FAST 1 y 28 CALL_FUNCTION 1 31 GET_ITER 32 FOR_ITER 17 to 52 35 STORE_FAST 3 j 4 38 LOAD_FAST 2 i 41 LOAD_FAST 3..

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

9 LOAD_CONST 1 100000000 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..