(🐞) `type` doesn't meet it's own type as a protocol
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
from typing import Protocol
class Type(Protocol):
__name__: str
__qualname__: str
__module__: str
a: type[object]
b: Type = object
c: Type = a # error: Incompatible types in assignment (expression has type "type[object]", variable has type "Type") [assignment]
a.__name__
a.__qualname__
a.__module__
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 mypy on the provided Protocol example and compare the assignment diagnostic with the successful attribute access on type[object]. Trace the type-checking path for protocol compatibility and type objects; done means the example treats type[object] consistently with the declared Type protocol without regressing related checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100