Skip to content

Dict[AbstractSet, Any] weird type error #1711

Closed
@berdario

Description

@berdario

I get Argument 1 to "f" has incompatible type Dict[frozenset[str], int]; expected Dict[AbstractSet[str], int]

with the following code:

from typing import AbstractSet, Dict

def f(v: Dict[AbstractSet[str], int]):
    pass

f({frozenset(['a']): 1})  # this works
x = {frozenset(['a']): 1}
f(x) # this fails

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