KotlinIsland / KotlinIsland/basedmypy

Wacky `dict` `reveal_type` moment

Open
#667 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
a = reveal_type({ # Revealed type is "dict['C' | 'D', None]"
"A": None,
"B": None,
"C": None,
"D": None,
})
reveal_type(a) # Revealed type is "dict[str, None]"
```

Contributor guide

Open the contributing guide

Research direction

Start by running the provided snippet through basedmypy and compare the inline and subsequent reveal_type results. Trace the dictionary-literal type inference to determine why the two outputs differ; done means the behavior is explained or corrected and covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.