KotlinIsland / KotlinIsland/basedmypy

union in string annotation invalid error

Open
#797 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.