Skip to content

Unexpected '...' for homogeneous tuples using builtin list, set (PEP 585) #14707

@ibondar-altilan

Description

@ibondar-altilan

Bug Report

The same error for tuple was fixed in #10766 but I see now an error "Unexpected" for the builtin types list, set:

To Reproduce

# the snippet
l = list[str, ...]  # error

t = tuple[str, ...]  # no error

s = set[str, ...]  # error

Expected Behavior
No errors

Actual Behavior
test.py:1: error: Unexpected "..." [misc]
test.py:1: error: "list" expects 1 type argument, but 2 given [type-arg]
test.py:5: error: Unexpected "..." [misc]
test.py:5: error: "set" expects 1 type argument, but 2 given [type-arg]
Found 4 errors in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.0.0
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): default after installation
  • Python version used: 3.10.5

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