Skip to content

error: Unsupported operand types for + ("Tuple[Tuple[int]]" and "Tuple[Tuple[int, ...], ...]") #6337

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
bmerry opened this issue Feb 5, 2019 · 1 comment

Comments

@bmerry
Copy link
Contributor

bmerry commented Feb 5, 2019

I don't know enough to know if this is a problem in typeshed or mypy - apologies if it's misfiled.

  • Are you reporting a bug, or opening a feature request?

Bug

  • Please insert below the code you are checking with mypy
from typing import Tuple

def add(x: Tuple[Tuple[int, ...], ...]) -> Tuple[Tuple[int, ...], ...]:
    return ((3,),) + x
  • What is the actual behavior/output?
add_tuple.py:4: error: Unsupported operand types for + ("Tuple[Tuple[int]]" and "Tuple[Tuple[int, ...], ...]")
  • What is the behavior/output you expect?

I expect this to pass, since this should always be a valid operation.

  • What are the versions of mypy and Python you are using?
    Do you see the same issue after installing mypy from Git master?

mypy 0.660; Python 3.6.6. I tried git master but pip install git+git://github.com/python/mypy.git fails.

  • What are the mypy flags you are using? (For example --strict-optional)

None

@ilevkivskyi
Copy link
Member

Duplicate of #224

@ilevkivskyi ilevkivskyi marked this as a duplicate of #224 Feb 5, 2019
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

2 participants