KotlinIsland / KotlinIsland/basedmypy
union in string annotation invalid error
Open
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
```py
a: "list[int] | None"
```
```py
> mypy test.py --tb --python-version 3.8
test.py:1:4: error: "list" is not subscriptable, use "typing.List" instead [misc]
a: "list[int] | None"
^
Found 1 error in 1 file (checked 1 source file)
```
Contributor guide
Research direction
Reproduce the issue using the shown test.py annotation and the `mypy test.py --tb --python-version 3.8` command. Trace the handling of string annotations and the reported error, then verify that this annotation no longer produces the invalid “list is not subscriptable” diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100