Scalpel
Scalpel copied to clipboard
type inference using type conversion
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'