KotlinIsland / KotlinIsland/basedmypy

conditional expressions don't apply always true logic

Open
#746 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
from typing import TYPE_CHECKING

b = 1 if TYPE_CHECKING else ""
reveal_type(b) # int | str
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue's Python snippet and trace how conditional expressions handle TYPE_CHECKING in the type-checking logic. Identify the relevant implementation and tests for conditional-expression inference; done means the revealed type reflects TYPE_CHECKING's always-true behavior instead of int | str.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.