¡@

Home 

python Programming Glossary: compare_op

Why is startswith slower than slicing

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

0 x 3 LOAD_CONST 0 3 6 SLICE 2 7 LOAD_NAME 1 y 10 COMPARE_OP 2 13 RETURN_VALUE In 9 dis_it 'x.startswith y ' 1 0 LOAD_NAME..

Weird Integer Cache inside Python 2.6

http://stackoverflow.com/questions/15171695/weird-integer-cache-inside-python-2-6

9 STORE_FAST 1 b 4 12 LOAD_FAST 0 a 15 LOAD_FAST 1 b 18 COMPARE_OP 8 is 21 PRINT_ITEM 22 PRINT_NEWLINE 23 LOAD_CONST 0 None 26..

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.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 Stylistically I try to avoid not x..

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

0 x 3 6 LOAD_FAST 0 x 9 LOAD_CONST 1 'google.com' 12 COMPARE_OP 8 is 15 RETURN_VALUE so in this particular implementation within..

Python Compilation/Interpretation Process

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

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 17 12 POP_TOP 13 LOAD_FAST 0 n 16 RETURN_VALUE.. fib.func_code.co_consts None 2 1 The next instruction COMPARE_OP 0 tells the interpreter to pop the two topmost stack elements..

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

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

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 13 JUMP_FORWARD.. 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 13 JUMP_FORWARD..

Why does removing the else slow down my code?

http://stackoverflow.com/questions/8203696/why-does-removing-the-else-slow-down-my-code

In 6 dis.dis fact1 2 0 LOAD_FAST 0 n 3 LOAD_CONST 1 2 6 COMPARE_OP 0 9 JUMP_IF_FALSE 5 to 17 12 POP_TOP 3 13 LOAD_CONST 2 1 16.. In 7 dis.dis fact2 2 0 LOAD_FAST 0 n 3 LOAD_CONST 1 2 6 COMPARE_OP 0 9 JUMP_IF_FALSE 5 to 17 12 POP_TOP 3 13 LOAD_CONST 2 1 16..

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

28 to 37 9 LOAD_NAME 0 i # 12 LOAD_CONST 1 100000000 # 15 COMPARE_OP 0 # 18 JUMP_IF_FALSE 14 to 35 # 21 POP_TOP # 3 22 LOAD_NAME..

Order of syntax for using 'not' and 'in' keywords

http://stackoverflow.com/questions/8738388/order-of-syntax-for-using-not-and-in-keywords

2 0 LOAD_CONST 1 'ham' 3 LOAD_CONST 2 'spam and eggs' 6 COMPARE_OP 7 not in 9 POP_TOP 10 LOAD_CONST 0 None 13 RETURN_VALUE def.. 2 0 LOAD_CONST 1 'ham' 3 LOAD_CONST 2 'spam and eggs' 6 COMPARE_OP 7 not in 9 POP_TOP 10 LOAD_CONST 0 None 13 RETURN_VALUE def.. 2 0 LOAD_CONST 1 'ham' 3 LOAD_CONST 2 'spam and eggs' 6 COMPARE_OP 7 not in 9 POP_TOP 10 LOAD_CONST 0 None 13 RETURN_VALUE def..