¡@

Home 

python Programming Glossary: store_fast

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_FAST 0 i 3 19 JUMP_ABSOLUTE 13 22 POP_BLOCK 23 LOAD_CONST 0 None.. LOAD_CONST 2 None 26 RETURN_VALUE The difference is that STORE_FAST is faster than STORE_NAME . This is because in a function i..

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

'Foo' 13 CALL_FUNCTION 2 2 positional 0 keyword pair 16 STORE_FAST 0 Foo 5 19 LOAD_FAST 0 Foo 22 RETURN_VALUE The first LOAD_CONST.. 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 2 18 JUMP_ABSOLUTE 6.. 5 0 BUILD_LIST 0 3 LOAD_FAST 0 .0 6 FOR_ITER 12 to 21 9 STORE_FAST 1 i 12 LOAD_DEREF 0 x 15 LIST_APPEND 2 18 JUMP_ABSOLUTE 6..

Python string interning

http://stackoverflow.com/questions/15541404/python-string-interning

exactly the same # s1 string 2 0 LOAD_CONST 1 'string' 3 STORE_FAST 0 s1 # s2 strin g 3 6 LOAD_CONST 4 'string' 9 STORE_FAST 1.. STORE_FAST 0 s1 # s2 strin g 3 6 LOAD_CONST 4 'string' 9 STORE_FAST 1 s2 The third example involves a run time concatenation the.. # s3a strin # s3 s3a g 4 12 LOAD_CONST 2 'strin' 15 STORE_FAST 2 s3a 5 18 LOAD_FAST 2 s3a 21 LOAD_CONST 3 'g' 24 BINARY_ADD..

Why “is” keyword has different behavior when there is dot in the string?

http://stackoverflow.com/questions/2858603/why-is-keyword-has-different-behavior-when-there-is-dot-in-the-string

... dis.dis f 2 0 LOAD_CONST 1 'google.com' 3 STORE_FAST 0 x 3 6 LOAD_FAST 0 x 9 LOAD_CONST 1 'google.com' 12 COMPARE_OP..

Python function local name binding from an outer scope

http://stackoverflow.com/questions/3908335/python-function-local-name-binding-from-an-outer-scope

'LOAD_FAST' LOAD_GLOBAL opcode.opmap 'LOAD_GLOBAL' STORE_FAST opcode.opmap 'STORE_FAST' DEBUGGING True def append_arguments.. opcode.opmap 'LOAD_GLOBAL' STORE_FAST opcode.opmap 'STORE_FAST' DEBUGGING True def append_arguments code_obj new_locals co_varnames..

Fastest way to swap elements in Python list

http://stackoverflow.com/questions/4554130/fastest-way-to-swap-elements-in-python-list

'swap2 ' dis.dis swap2 output swap1 6 0 LOAD_CONST 1 5 3 STORE_FAST 0 a 7 6 LOAD_CONST 2 4 9 STORE_FAST 1 b 8 12 LOAD_FAST 1 b.. 6 0 LOAD_CONST 1 5 3 STORE_FAST 0 a 7 6 LOAD_CONST 2 4 9 STORE_FAST 1 b 8 12 LOAD_FAST 1 b 15 LOAD_FAST 0 a 18 ROT_TWO 19 STORE_FAST.. 1 b 8 12 LOAD_FAST 1 b 15 LOAD_FAST 0 a 18 ROT_TWO 19 STORE_FAST 0 a 22 STORE_FAST 1 b 25 LOAD_CONST 0 None 28 RETURN_VALUE swap2..

Cyclic module dependencies and relative imports in Python

http://stackoverflow.com/questions/6351805/cyclic-module-dependencies-and-relative-imports-in-python

2 'bar' 6 IMPORT_NAME 0 foo 9 IMPORT_FROM 1 bar 12 STORE_FAST 0 bar 15 POP_TOP 16 LOAD_CONST 0 None 19 RETURN_VALUE hmm interesting..

Are tuples more efficient than lists in Python?

http://stackoverflow.com/questions/68630/are-tuples-more-efficient-than-lists-in-python

3 3 9 LOAD_CONST 4 4 12 LOAD_CONST 5 5 15 BUILD_LIST 5 18 STORE_FAST 0 x 3 21 LOAD_FAST 0 x 24 LOAD_CONST 2 2 27 BINARY_SUBSCR 28.. x 3 21 LOAD_FAST 0 x 24 LOAD_CONST 2 2 27 BINARY_SUBSCR 28 STORE_FAST 1 y 31 LOAD_CONST 0 None 34 RETURN_VALUE dis.dis b 2 0 LOAD_CONST.. 34 RETURN_VALUE dis.dis b 2 0 LOAD_CONST 6 1 2 3 4 5 3 STORE_FAST 0 x 3 6 LOAD_FAST 0 x 9 LOAD_CONST 2 2 12 BINARY_SUBSCR 13..