KotlinIsland / KotlinIsland/basedmypy

Bare literal types (without `Literal`) and support `ForwardRef` in types tracking issue

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
future-annotations
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
# from __future__ import annotations
from typing import ForwardRef

def foo(a: "asdf") -> True: # literal string `"asdf"`
...

MyType: TypeAlias = int | ForwardRef("asdf") # a forward reference to the type `asdf`
```

- [x] support non string literal types (#137)
- [x] int
- [x] bool
- [x] Enum
- [ ] tuple
- [ ] support strings as literal types in type annotations (#361)
- [ ] support `ForwardRef` or some alternative in type aliases

An easy route would be to not use `ForwardRef` at all and just force usage of `Literal` in type aliases.

Contributor guide

Open the contributing guide

Research direction

Start with the checklist and review the referenced issues #137 and #361 to understand the existing type-tracking behavior. The remaining scope covers tuple literals, strings as literal types in annotations, and ForwardRef or an alternative in type aliases; done means the selected support is implemented and its behavior is covered by the project’s tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.