¡@

Home 

python Programming Glossary: load_attr

How should I understand the output of dis.dis?

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

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 0 3 12 CALL_FUNCTION.. d 3 ' ' none ' 'eval' 1 0 LOAD_NAME 0 heapq 3 LOAD_ATTR 1 nlargest 6 LOAD_NAME 2 d 9 LOAD_CONST 0 3 12 CALL_FUNCTION.. with the oparg 0000 then at offset 3 6a is the opcode LOAD_ATTR with 0100 the oparg and so on. Note that the opargs are in little..

Why is startswith slower than slicing

http://stackoverflow.com/questions/13270888/why-is-startswith-slower-than-slicing

In 9 dis_it 'x.startswith y ' 1 0 LOAD_NAME 0 x 3 LOAD_ATTR 1 startswith 6 LOAD_NAME 2 y 9 CALL_FUNCTION 1 12 RETURN_VALUE..

How to cleanly keep below 80-char width with long strings?

http://stackoverflow.com/questions/15664101/how-to-cleanly-keep-below-80-char-width-with-long-strings

0 6 POP_JUMP_IF_FALSE 25 3 9 LOAD_GLOBAL 1 logger 12 LOAD_ATTR 2 info 15 LOAD_CONST 1 Conditional's meaning happened so we're.. 0 6 POP_JUMP_IF_FALSE 29 3 9 LOAD_GLOBAL 1 logger 12 LOAD_ATTR 2 info 15 LOAD_CONST 1 Conditional's meaning happened so we're..

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

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

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 dis.dis f3 9 0..

Python class variable int vs array

http://stackoverflow.com/questions/16805648/python-class-variable-int-vs-array

Foo.n import dis dis.dis Foo.bar 5 0 LOAD_FAST 0 self 3 LOAD_ATTR 0 a 6 LOAD_ATTR 1 append 9 LOAD_CONST 1 'foo' 12 CALL_FUNCTION.. dis.dis Foo.bar 5 0 LOAD_FAST 0 self 3 LOAD_ATTR 0 a 6 LOAD_ATTR 1 append 9 LOAD_CONST 1 'foo' 12 CALL_FUNCTION 1 15 POP_TOP.. 1 15 POP_TOP 6 16 LOAD_FAST 0 self 19 DUP_TOP 20 LOAD_ATTR 2 n 23 LOAD_CONST 2 1 26 INPLACE_ADD 27 ROT_TWO 28 STORE_ATTR..

How do I override a parent class's functions in python?

http://stackoverflow.com/questions/2484215/how-do-i-override-a-parent-classs-functions-in-python

The disassembly is as follows 8 0 LOAD_FAST 0 self 3 LOAD_ATTR 0 _A__pick 6 CALL_FUNCTION 0 9 POP_TOP 10 LOAD_CONST 0 None.. LOAD_CONST 0 None 13 RETURN_VALUE 15 0 LOAD_FAST 0 self 3 LOAD_ATTR 0 _B__pick 6 CALL_FUNCTION 0 9 POP_TOP 10 LOAD_CONST 0 None..

Python import X or from X import Y? (performance)

http://stackoverflow.com/questions/3591962/python-import-x-or-from-x-import-y-performance

def f_1 random.seed dis.dis f_1 0 LOAD_GLOBAL 0 random 3 LOAD_ATTR 0 seed 6 CALL_FUNCTION 0 9 POP_TOP 10 LOAD_CONST 0 None 13 RETURN_VALUE..

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

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

we can assume that append version wastes cycles in LOAD_ATTR CALL_FUNCTION and version in BUILD_LIST . Apparently BUILD_LIST.. version in BUILD_LIST . Apparently BUILD_LIST outweighs LOAD_ATTR CALL_FUNCTION . import dis dis.dis compile s s.append 'spam'.. 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 1 18 POP_TOP..

Python: why are * and ** faster than / and sqrt()?

http://stackoverflow.com/questions/8068019/python-why-are-and-faster-than-and-sqrt

x3 # x4 math.sqrt 1234567890.0 7 22 LOAD_GLOBAL 0 math 25 LOAD_ATTR 1 sqrt 28 LOAD_CONST 1 1234567890.0 31 CALL_FUNCTION 1 34 STORE_FAST..

python factory functions compared to class

http://stackoverflow.com/questions/901892/python-factory-functions-compared-to-class

clsmaker.__call__ 5 0 LOAD_FAST 1 X 3 LOAD_FAST 0 self 6 LOAD_ATTR 0 N 9 BINARY_MULTIPLY 10 RETURN_VALUE act maker 3 dis act..