¡@

Home 

python Programming Glossary: load_fast

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

2 2 positional 0 keyword pair 16 STORE_FAST 0 Foo 5 19 LOAD_FAST 0 Foo 22 RETURN_VALUE The first LOAD_CONST there loads a code.. stdin line 2 'Foo' dis.dis foo.__code__.co_consts 1 2 0 LOAD_FAST 0 __locals__ 3 STORE_LOCALS 4 LOAD_NAME 0 __name__ 7 STORE_NAME.. foo.__code__.co_consts 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..

Python string interning

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

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 25 STORE_FAST 3 s3..

What do backticks mean to the python interpreter: `num`

http://stackoverflow.com/questions/1673071/what-do-backticks-mean-to-the-python-interpreter-num

shows import dis dis.dis f1 3 0 LOAD_GLOBAL 0 repr 3 LOAD_FAST 0 a 6 CALL_FUNCTION 1 9 RETURN_VALUE dis.dis f2 6 0 LOAD_FAST.. 0 a 6 CALL_FUNCTION 1 9 RETURN_VALUE dis.dis f2 6 0 LOAD_FAST 0 a 3 LOAD_ATTR 0 __repr__ 6 CALL_FUNCTION 0 9 RETURN_VALUE.. __repr__ 6 CALL_FUNCTION 0 9 RETURN_VALUE dis.dis f3 9 0 LOAD_FAST 0 a 3 UNARY_CONVERT 4 RETURN_VALUE f1 involves a global lookup..

Python `if x is not None` or `if not x is None`?

http://stackoverflow.com/questions/2710940/python-if-x-is-not-none-or-if-not-x-is-none

dis def f x ... return x is not None ... dis.dis f 2 0 LOAD_FAST 0 x 3 LOAD_CONST 0 None 6 COMPARE_OP 9 is not 9 RETURN_VALUE.. def g x ... return not x is None ... dis.dis g 2 0 LOAD_FAST 0 x 3 LOAD_CONST 0 None 6 COMPARE_OP 9 is not 9 RETURN_VALUE..

Python Compilation/Interpretation Process

http://stackoverflow.com/questions/3299648/python-compilation-interpretation-process

fib n 2 fib n 1 ... fib 10 55 import dis dis.dis fib 1 0 LOAD_FAST 0 n 3 LOAD_CONST 1 2 6 COMPARE_OP 0 9 JUMP_IF_FALSE 5 to.. 2 6 COMPARE_OP 0 9 JUMP_IF_FALSE 5 to 17 12 POP_TOP 13 LOAD_FAST 0 n 16 RETURN_VALUE 17 POP_TOP 18 LOAD_GLOBAL 0 fib 21 LOAD_FAST.. 0 n 16 RETURN_VALUE 17 POP_TOP 18 LOAD_GLOBAL 0 fib 21 LOAD_FAST 0 n 24 LOAD_CONST 1 2 27 BINARY_SUBTRACT 28 CALL_FUNCTION 1..

Efficient Numpy 2D array construction from 1D array

http://stackoverflow.com/questions/4923617/efficient-numpy-2d-array-construction-from-1d-array

Are tuples more efficient than lists in Python?

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

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 STORE_FAST 1 y 31.. 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 STORE_FAST 1 y 16..

Why is early return slower than else?

http://stackoverflow.com/questions/8271139/why-is-early-return-slower-than-else

of the disassembly in Python 2.7 dis.dis without_else 2 0 LOAD_FAST 0 param 3 POP_JUMP_IF_FALSE 10 3 6 LOAD_CONST 1 1 9 RETURN_VALUE.. 4 10 LOAD_CONST 2 0 13 RETURN_VALUE dis.dis with_else 2 0 LOAD_FAST 0 param 3 POP_JUMP_IF_FALSE 10 3 6 LOAD_CONST 1 1 9 RETURN_VALUE..