Skip to content

sum(List[Decimal]) + sum(List[Decimal]) incompatible type error #8814

Description

@myartsev

Using mypy-0.770 with no additional flags

from decimal import Decimal

foo = [Decimal("1"), Decimal("2")]
sum(foo)

sum(foo) + sum(foo)

The first sum statement is okay, but the second is an error: Argument 1 to "sum" has incompatible type "List[Decimal]"; expected "Iterable[int]" [arg-type]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions