Thanks to visit codestin.com
Credit goes to github.com

Skip to content

List concat with different types causes error #720

Closed
@noisecapella

Description

@noisecapella

When I run mypy on this code:

from typing import List, Any

def f(a: List[int], b: List[str]):
    return a+b

f([1,2,3], ["3","4","5"])

I get this error:
/home/georgeatmit/type1.py: note: In function "f":
/home/georgeatmit/type1.py:3: error: Unsupported operand types for + ("list" and List[str])

Is combining lists of different types supported at the moment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions