You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected '...' for homogeneous tuples using builtin tuple (PEP 585) #9980
This seems to affect more than just type aliases. When I tried to change the tuples in typeshed's stdlib/random.pyi, it complained with the same error message. (Using mypy 0.820+dev.9cbf4c0da8f83efd0ba82a91e180b6e96dd15f69 and Python 3.8.3.):
@srittau Interesting, I noticed it works in some places of our codebase, when I tried isolating them with e.g. mypy <(echo 'ordering: tuple[str, ...] = ("-pk",)' it fails. Might be something else going on that is shadowing those definitions I guess.
That's why I thought this was only happening for type aliases. I'll rename the issue.
Activity
srittau commentedon Feb 23, 2021
This seems to affect more than just type aliases. When I tried to change the tuples in typeshed's
stdlib/random.pyi, it complained with the same error message. (Using mypy 0.820+dev.9cbf4c0da8f83efd0ba82a91e180b6e96dd15f69 and Python 3.8.3.):Akuli commentedon Feb 23, 2021
mypy/mypy/checker.py
Line 951 in 4827f3a
Maybe this is the problem?
antonagestam commentedon Feb 23, 2021
@srittau Interesting, I noticed it works in some places of our codebase, when I tried isolating them with e.g.
mypy <(echo 'ordering: tuple[str, ...] = ("-pk",)'it fails. Might be something else going on that is shadowing those definitions I guess.That's why I thought this was only happening for type aliases. I'll rename the issue.
[-]Unexpected '...' for tuple alias [/-][+]Unexpected '...' for homogeneous tuples using builtin tuple (PEP 585)[/+]posita commentedon Jun 11, 2021
Is this a dup of #10242? Also, are you still seeing these errors?
☝️ Those don't appear for me in 0.901, but these do: 👇
Use typing type instead of builtin type for tuple
Fixes to generic builtin types (#10766)
sg495 commentedon Jul 28, 2021
This is still happening to me on 0.910. Here is a snippet:
Here are the mypy version check and output:
posita commentedon Jul 28, 2021
I think the fix was landed after 0.910 was released. @JukkaL, can you confirm whether it will make it into the next one?
MatthieuDartiailh commentedon Sep 7, 2021
@JukkaL any update on when this will be released ?
ergoithz commentedon Oct 24, 2021
Furthermore, any plans on releasing this fix before Python 4?
hauntsaninja commentedon Oct 31, 2021
You can follow #11158 for the release. I can promise you that this will be released before Python 4 :D
Add fix for python/mypy#9980