Python Forum
How to verify widening conversion?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to verify widening conversion?
#1
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?
buran write Apr-08-2023, 06:37 AM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Reply


Messages In This Thread
How to verify widening conversion? - by quazirfan - Apr-08-2023, 03:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Verify input as integer and not blank GMCobraz 3 2,897 Jun-22-2020, 02:47 PM
Last Post: pyzyx3qwerty
  How to verify the give number is valid Mekala 3 3,208 May-16-2020, 02:40 PM
Last Post: anbu23
  Unable to verify python versio ThereIsNoSpoom 2 2,426 Jan-15-2020, 09:12 AM
Last Post: DeaD_EyE
  Verify if .docx table of contents is updated as per document sections or not vintysaw 0 5,236 Oct-24-2019, 12:01 PM
Last Post: vintysaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020