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

False-positive "Argument 1 to np.concatenate has incompatible type" #12144

Closed
bersbersbers opened this issue Feb 7, 2022 · 2 comments
Closed
Labels
bug mypy got something wrong

Comments

@bersbersbers
Copy link

Bug Report

False-positive "Argument 1 to np.concatenate has incompatible type"

To Reproduce

import numpy as np
print(np.concatenate((np.array([1]), [2])))

Expected Behavior

python bug.py works fine, printing [1 2], so I would expect mypy bug.py not to report an error.

Actual Behavior

Argument 1 to "concatenate" has incompatible type "Tuple[ndarray[Any, dtype[Any]], List[int]]"; expected "Union[_SupportsArray[dtype[]], Sequence[_SupportsArray[dtype[]]], Sequence[Sequence[_SupportsArray[dtype[]]]], Sequence[Sequence[Sequence[_SupportsArray[dtype[]]]]], Sequence[Sequence[Sequence[Sequence[_SupportsArray[dtype[]]]]]]]"

Your Environment

  • Mypy version used: mypy 0.931
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.10.2
  • Operating system and version: Linux
@bersbersbers bersbersbers added the bug mypy got something wrong label Feb 7, 2022
@JMMarchant
Copy link

This is related to numpy/numpy#20901 and appears to be an @overload issue of some description.

I can confirm this still exists on numpy 1.22.4 and mypy 1.1.1

@JelleZijlstra
Copy link
Member

This seems like an issue in numpy. Please report a mypy issue only if you believe mypy is behaving incorrectly.

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
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

3 participants