¡@

Home 

python Programming Glossary: load_name

Why does Python code run faster in a function?

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

At top level the bytecode is 1 0 SETUP_LOOP 20 to 23 3 LOAD_NAME 0 xrange 6 LOAD_CONST 3 100000000 9 CALL_FUNCTION 1 12 GET_ITER..

How should I understand the output of dis.dis?

http://stackoverflow.com/questions/12673074/how-should-i-understand-the-output-of-dis-dis

JUMP_FORWARD 28019 to 28028 9 STORE_GLOBAL 27756 27756 12 LOAD_NAME 29811 29811 15 STORE_SLICE 0 16 LOAD_CONST 13100 13100 19 STORE_SLICE.. d n dis.dis f_heapq d 3 0 BUILD_TUPLE 26719 3 LOAD_NAME 28769 28769 6 JUMP_ABSOLUTE 25640 9 44 # what is 44 10 DELETE_SLICE.. 2012 22 28 10 import dis dis.dis 'heapq.nlargest d 3 ' 1 0 LOAD_NAME 0 heapq 3 LOAD_ATTR 1 nlargest 6 LOAD_NAME 2 d 9 LOAD_CONST..

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

1 2 0 LOAD_FAST 0 __locals__ 3 STORE_LOCALS 4 LOAD_NAME 0 __name__ 7 STORE_NAME 1 __module__ 10 LOAD_CONST 0 'foo... 3 'foo. locals .Foo. listcomp ' 28 MAKE_FUNCTION 0 31 LOAD_NAME 4 range 34 LOAD_CONST 4 1 37 CALL_FUNCTION 1 1 positional.. bytecode there instead here is output from Python 2.7 2 0 LOAD_NAME 0 __name__ 3 STORE_NAME 1 __module__ 3 6 LOAD_CONST 0 5 9..

if loop: x not in VS not x in [duplicate]

http://stackoverflow.com/questions/3481554/if-loop-x-not-in-vs-not-x-in

dis dis.dis compile 'if x not in d pass' '' 'exec' 1 0 LOAD_NAME 0 x 3 LOAD_NAME 1 d 6 COMPARE_OP 7 not in 9 JUMP_IF_FALSE.. 'if x not in d pass' '' 'exec' 1 0 LOAD_NAME 0 x 3 LOAD_NAME 1 d 6 COMPARE_OP 7 not in 9 JUMP_IF_FALSE 4 to 16 12 POP_TOP.. dis.dis compile 'if not x in d pass' '' 'exec' 1 0 LOAD_NAME 0 x 3 LOAD_NAME 1 d 6 COMPARE_OP 7 not in 9 JUMP_IF_FALSE..

In Python, what is the difference between “.append()” and “+= []”?

http://stackoverflow.com/questions/725782/in-python-what-is-the-difference-between-append-and

'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' 15 CALL_FUNCTION.. 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 15 INPLACE_ADD 16..