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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

(馃悶) inconsistent behavior of initial assignment (int/float in tuple) #1029

Open
KotlinIsland opened this issue Oct 26, 2023 · 1 comment

Comments

@KotlinIsland
Copy link

KotlinIsland commented Oct 26, 2023

from testFloatOps.test_tuples

def f() -> None:
    a = 1
    b: tuple[float] = (a,)
    assert b == (1.0,)
    
    b = (a,)
    assert b == (1.0,)  # TypeError: int object expected; got float

Please forgive my ignorance if this has been raised already, I'm not at all familiar with mypyc.

@KotlinIsland
Copy link
Author

Found another one:

def f() -> None:
    z: float = True
    assert z == True
    z = True
    assert z == True  # TypeError: bool object expected; got float
f()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant