Last active
July 3, 2019 13:03
-
-
Save varl/7728002126548cef9086e9ef0d41c306 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def test(): | |
... return (1<2)==(1<2) | |
... | |
>>> dis.dis(test) | |
2 0 LOAD_CONST 1 (1) | |
2 LOAD_CONST 2 (2) | |
4 COMPARE_OP 0 (<) | |
6 LOAD_CONST 1 (1) | |
8 LOAD_CONST 2 (2) | |
10 COMPARE_OP 0 (<) | |
12 COMPARE_OP 2 (==) | |
14 RETURN_VALUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def test(): | |
... return 1<2==1<2 | |
... | |
>>> dis.dis(test) | |
2 0 LOAD_CONST 1 (1) | |
2 LOAD_CONST 2 (2) | |
4 DUP_TOP | |
6 ROT_THREE | |
8 COMPARE_OP 0 (<) | |
10 JUMP_IF_FALSE_OR_POP 28 | |
12 LOAD_CONST 1 (1) | |
14 DUP_TOP | |
16 ROT_THREE | |
18 COMPARE_OP 2 (==) | |
20 JUMP_IF_FALSE_OR_POP 28 | |
22 LOAD_CONST 2 (2) | |
24 COMPARE_OP 0 (<) | |
26 RETURN_VALUE | |
>> 28 ROT_TWO | |
30 POP_TOP | |
32 RETURN_VALUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def test(): | |
... return 2>1==1<2 | |
... | |
>>> dis.dis(test) | |
2 0 LOAD_CONST 1 (2) | |
2 LOAD_CONST 2 (1) | |
4 DUP_TOP | |
6 ROT_THREE | |
8 COMPARE_OP 4 (>) | |
10 JUMP_IF_FALSE_OR_POP 28 | |
12 LOAD_CONST 2 (1) | |
14 DUP_TOP | |
16 ROT_THREE | |
18 COMPARE_OP 2 (==) | |
20 JUMP_IF_FALSE_OR_POP 28 | |
22 LOAD_CONST 1 (2) | |
24 COMPARE_OP 0 (<) | |
26 RETURN_VALUE | |
>> 28 ROT_TWO | |
30 POP_TOP | |
32 RETURN_VALUE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment