Message318016
Hi,
Maybe already discussed with Victor but I think there is no optimization when we have this simple case for float(X) and int(X)
Example:
>>> import dis
>>> dis.dis("x = float(0)")
1 0 LOAD_NAME 0 (float)
2 LOAD_CONST 0 (0)
4 CALL_FUNCTION 1
6 STORE_NAME 1 (x)
8 LOAD_CONST 1 (None)
10 RETURN_VALUE
>>> dis.dis("x = 1 + 1")
1 0 LOAD_CONST 0 (2)
2 STORE_NAME 0 (x)
4 LOAD_CONST 1 (None)
6 RETURN_VALUE
>>> dis.dis("x = int(0)")
1 0 LOAD_NAME 0 (int)
2 LOAD_CONST 0 (0)
4 CALL_FUNCTION 1
6 STORE_NAME 1 (x)
8 LOAD_CONST 1 (None)
10 RETURN_VALUE
>>>
There is an optim for x = 1 + 1 |
|
Date |
User |
Action |
Args |
2018-05-29 12:47:12 | matrixise | set | recipients:
+ matrixise, vstinner |
2018-05-29 12:47:12 | matrixise | set | messageid: <1527598032.12.0.682650639539.issue33682@psf.upfronthosting.co.za> |
2018-05-29 12:47:12 | matrixise | link | issue33682 messages |
2018-05-29 12:47:12 | matrixise | create | |
|