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

Tuple is incompatible with tuple #1120

Closed
decorator-factory opened this issue Oct 24, 2020 · 4 comments
Closed

Tuple is incompatible with tuple #1120

decorator-factory opened this issue Oct 24, 2020 · 4 comments
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@decorator-factory
Copy link

Python 3.9 and latest version of Pyright/Pylance.

def f(xs: Tuple[str, ...]):
    return xs

f(tuple(["a", "b"]))

error:

"Argument of type "tuple[str, ...]" cannot be assigned to parameter "xs" of type "Tuple[str, ...]" in function "f"
  "tuple[str, ...]" is incompatible with "Tuple[str, ...]"
@decorator-factory decorator-factory changed the title Tuple != tuple? Tuple is incompatible with tuple Oct 24, 2020
@erictraut
Copy link
Collaborator

I'm not able to repro this with either Pylance or Pyright. Can you double-check your code sample above and verify that it repros the problem for you? Are there any other special settings that you're using (e.g. a different version of typeshed stubs than those that ship with Pylance/Pyright)?

@erictraut erictraut added the question Further information is requested label Oct 24, 2020
@decorator-factory
Copy link
Author

decorator-factory commented Oct 25, 2020

This is some kind of a heisenbug. Sometimes it appears, and sometimes it does not (e.g. when I open the module for the second time). I don't have anything special settings. I'll investigate this more.

@erictraut erictraut added addressed in next version Issue is fixed and will appear in next published version bug Something isn't working and removed question Further information is requested labels Oct 31, 2020
@erictraut
Copy link
Collaborator

I was finally able to repro this. A fix will be in the next release.

@erictraut
Copy link
Collaborator

This is addressed in pyright 1.1.83, which was just published. It will also be included in the next release of pylance.

heejaechang pushed a commit to heejaechang/pyright that referenced this issue Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants