Mypy crashes when using `reveal_type` on large literal int
Open
Nobody has claimed this yet.
crash
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
I noticed this issue when exploring a feature request in pyright.
The following code results in an "INTERNAL ERROR" when running mypy.
from typing import Final
MY_CONST: Final = 2**100000
reveal_type(MY_CONST)
This is admittedly an edge case, perhaps not worth fixing.
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 Python snippet with mypy and reproduce the INTERNAL ERROR from reveal_type on the large Final integer. Trace the reveal_type handling for this case; done means mypy no longer crashes while still reporting the revealed type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100