KotlinIsland / KotlinIsland/basedmypy
`helpful-string` incorrectly triggers on every generic
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the problem, ie expected/actual result (if it's not blatantly obvious)
_No response_
### Gist to reproduce
```python
from typing import TypeVar
_T = TypeVar("_T", bound=int)
def asdf(a: _T, b: int):
print(f"{a}") # error: The type "_T@asdf" doesn't define a __format__, __str__ or __repr__ [helpful-string]
print(f"{b}")
```
Contributor guide
Research direction
Start by running the Python reproduction in the issue with the helpful-string diagnostic enabled, comparing the reported results for the TypeVar argument and the int argument. Trace the diagnostic's handling of generic types and verify that the reproduced case no longer reports an incorrect error.
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