Scalpel icon indicating copy to clipboard operation
Scalpel copied to clipboard

type inference using type conversion

Open shashank-g12 opened this issue 1 year ago • 1 comments

Using type conversion operators such as int() or str() is not taken into account when assigning type information to variables. For eg

import math
def main():
    a = int(input())
    b = int(input())
    bstr = str(b)
    num = a * 10 ** len(bstr) + b

    for i in range(1, 100100):
        if i * i == num:
            break
    if i > 100100:
        print("No")
    else:
        print("Yes")
main()

In this type infered for variable a and b should be int and for bstr it should be string but type inference module shows 'Any'

shashank-g12 avatar Jan 01 '24 17:01 shashank-g12