(🐞) False positive for explicit `Any` with inferred `Type[type]`
Open
Nobody has claimed this yet.
bug
topic-disallow-any
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
type # no error
t1 = type # error: Expression type contains "Any" (has type "Type[type]")
t2: type[type] = type # no error
t3: Type[type] = type # no error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided snippet through mypy and compare diagnostics for each assignment. Trace the type-checking path that reports “Expression type contains Any” for t1; done means the explicit Any case no longer produces a false positive while the other examples retain their current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100