python / python/mypy

Disallow plain `Concatenate[...]` as type hint

Open
#21,425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-paramspec
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Bug Report

Pretty sure this is not OK.

To Reproduce

from typing import Concatenate

x: Concatenate[...]

Expected Behavior

error

Actual Behavior

no error

Your Environment

reproduced in mypy-play.

  • Mypy version used: 1.20.2
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the snippet in mypy-play and confirm that plain Concatenate[...] currently produces no error. Trace the existing Concatenate type-hint handling, then add coverage for this example so the completed change reports an error for the invalid annotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.