Skip to content

Built-in generics as super classes #10731

Closed

Description

@srittau

Bug Report

Please consider the following stub file:

class Foo(list[str]):
    bar: list[str]

When checking this with mypy --python-version=3.8 foo.pyi (mypy 0.910, Python 3.9.4), I get the following output:

foo.pyi:1: error: "list" is not subscriptable
Found 1 error in 1 file (checked 1 source file)

Please note that it complains about line 1, but not line 2. It will not complain when running in Python 3.9+ mode. See also #9980 and #10303.

Activity

  1. added a commit that references this issue on Jul 5, 2021
    6eafc5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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