Skip to content

Regression with ellipsis handling in v1.9.0 #17019

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

Closed
aiudirog opened this issue Mar 12, 2024 · 2 comments
Closed

Regression with ellipsis handling in v1.9.0 #17019

aiudirog opened this issue Mar 12, 2024 · 2 comments
Labels
bug mypy got something wrong

Comments

@aiudirog
Copy link

Bug Report

With v1.9.0, ... no longer appears to be considered the only instance of the EllipsisType and this causes type narrowing to not function properly.

To Reproduce

from types import EllipsisType
x: int | str | EllipsisType = ...
y: int | str = 0 if x is ... else x

https://mypy-play.net/?mypy=1.9.0&python=3.12&flags=strict&gist=02e73fd9b069629261e7328ab3530973

Expected Behavior

No errors, as it behaved on 1.8.0:

Success: no issues found in 1 source file

Actual Behavior

main.py:3: error: Incompatible types in assignment (expression has type "int | str | EllipsisType", variable has type "int | str")  [assignment]
Found 1 error in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.9.0
  • Mypy command-line flags: --strict
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.10.13 & 3.12 (in the playground)
@aiudirog aiudirog added the bug mypy got something wrong label Mar 12, 2024
@JelleZijlstra
Copy link
Member

Duplicate of #17002

@JelleZijlstra JelleZijlstra marked this as a duplicate of #17002 Mar 12, 2024
@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@aiudirog
Copy link
Author

My apologies, I must have only checked open tickets and didn't see the closed one

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

No branches or pull requests

2 participants