Skip to content

Augmented assignment leads to type complaints #2098

@JdeH

Description

@JdeH

Hi,

I am using mypy 0.4.4. It seems augmented assignments aren't yet dealt with correctly.

weight0 = 65.5
weight0 = 65
weight0 *= 0.5                  # Gives error, unsup operand types for * ("int" and "float")
weight1 = 65.5
weight1 = 65
weight1 = weight1 * 0.5    # Gives no error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions