Skip to content

Using TypedDict in stub files with new analyzer produces error #7028

@bryanforbes

Description

@bryanforbes

mypy version: 0.710
Python version: 3.7.7

Given the following stub file (test.pyi):

from typing_extensions import TypedDict

class StuffDict(TypedDict):
    foo: str
    bar: int

def thing(stuff: StuffDict) -> int: ...

Running mypy --new-semantic-analyzer test.pyi produces the following output:

test.pyi: error: Class test.StuffDict has abstract attributes "__getitem__", "__iter__", "__len__"
test.pyi: note: If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions