I am trying to understand why I can not see int to float widening in Python bytecode.
here is the code:
import dis
dis.dis("5.0 == 5")
Output:
0 0 RESUME 0
1 2 LOAD_CONST 0 (5.0)
4 LOAD_CONST 1 (5)
6 COMPARE_OP 2 (==)
12 RETURN_VALUE
If the widening is not present in the bytecode - is there another way I can verify it?
here is the code:
import dis
dis.dis("5.0 == 5")
Output:
0 0 RESUME 0
1 2 LOAD_CONST 0 (5.0)
4 LOAD_CONST 1 (5)
6 COMPARE_OP 2 (==)
12 RETURN_VALUE
If the widening is not present in the bytecode - is there another way I can verify it?
buran write Apr-08-2023, 06:37 AM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.