Skip to content

Inconsistent behavior with list(reduce(...)) #8861

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

Open
rafalslaby opened this issue May 20, 2020 · 0 comments
Open

Inconsistent behavior with list(reduce(...)) #8861

rafalslaby opened this issue May 20, 2020 · 0 comments
Labels
bug mypy got something wrong

Comments

@rafalslaby
Copy link

rafalslaby commented May 20, 2020

from functools import reduce

tmp = reduce(lambda x, y: x + y, [[1], [2]])
# this works fine
result = list(tmp) 

# but this one produces an error:
#  Unsupported left operand type for + ("Iterable[int]")
result = list(reduce(lambda x, y: x + y, [[1], [2]]))
$ mypy --version
mypy 0.770

Python version:

>>> sys.version
'3.8.2 (default, May 20 2020, 18:13:32) \n[GCC 7.5.0]'
@AlexWaygood AlexWaygood added the bug mypy got something wrong label Mar 28, 2022
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