This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author matrixise
Recipients matrixise, vstinner
Date 2018-05-29.12:47:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527598032.12.0.682650639539.issue33682@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-05-29 12:47:12matrixisesetrecipients: + matrixise, vstinner
2018-05-29 12:47:12matrixisesetmessageid: <1527598032.12.0.682650639539.issue33682@psf.upfronthosting.co.za>
2018-05-29 12:47:12matrixiselinkissue33682 messages
2018-05-29 12:47:12matrixisecreate