Skip to content

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

Closed

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

Activity

  1. ilevkivskyi commented on Jun 20, 2019

    @ilevkivskyi
    Member

    Thanks for reporting! This looks like something important to investigate.

  2. added
    bug
    false-positive
    semantic-analyzer
    on Jun 20, 2019
  3. self-assigned this
    on Jun 25, 2019
  4. added a commit that references this issue on Jun 25, 2019
    7823f6c
  5. added a commit that references this issue on Jun 25, 2019
    f24119f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfalse-positivepriority-0-highsemantic-analyzertopic-typed-dict

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions