Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type inference using type conversion #120

Open
shashank-g12 opened this issue Jan 1, 2024 · 1 comment
Open

type inference using type conversion #120

shashank-g12 opened this issue Jan 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@shashank-g12
Copy link

shashank-g12 commented Jan 1, 2024

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 shashank-g12 changed the title type inference using type coversion type inference using type conversion Jan 1, 2024
@Jarvx
Copy link
Collaborator

Jarvx commented Jan 3, 2024

Indeed, this is a bug! Thanks for reporting. I will close this issue once this is fixed

@Jarvx Jarvx self-assigned this Jan 3, 2024
@Jarvx Jarvx added the bug Something isn't working label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants