¡@

Home 

python Programming Glossary: rot_two

Python class variable int vs array

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

20 LOAD_ATTR 2 n 23 LOAD_CONST 2 1 26 INPLACE_ADD 27 ROT_TWO 28 STORE_ATTR 2 n 31 LOAD_CONST 0 None 34 RETURN_VALUE In other..

Is a variable swap guaranteed to be atomic in python?

http://stackoverflow.com/questions/2623086/is-a-variable-swap-guaranteed-to-be-atomic-in-python

dis.dis swap_xy 3 0 LOAD_GLOBAL 0 y 3 LOAD_GLOBAL 1 x 6 ROT_TWO 7 STORE_GLOBAL 1 x 10 STORE_GLOBAL 0 y 13 LOAD_CONST 0 None.. between the LOAD_GLOBAL bytecodes before or after the ROT_TWO and between the STORE_GLOBAL bytecodes. If you want to swap..

Fastest way to swap elements in Python list

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

4 9 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.. 1 b 30 LOAD_CONST 0 None 33 RETURN_VALUE Two loads a ROT_TWO and two saves versus three loads and three saves. You are unlikely..