KotlinIsland / KotlinIsland/basedmypy

f-strings with unformattable values can break inferred literals in overloads

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

Description

```py
from typing import overload

@overload
def f(): ...

@overload
def f(s: str, a: True = ...): ...

def f(s="", a=True): ...

v: None

f(f"{v}", True)
```

Contributor guide

Open the contributing guide

Research direction

Start by running the Python reproducer with basedmypy and inspect the checker paths for f-string inference and overload resolution. Determine the intended inferred type for the formatted value and verify that the overload result no longer changes incorrectly for an unformattable value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
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.