KotlinIsland / KotlinIsland/basedtyping

design how to interact with `SpecialForm`s

Open
#99 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12
Forks
2
PR merge metrics
No merged PRs in 30d

Description

```py
from typing import get_args

def literal_to_tuple(f: TypeForm[Literal[Unpack[Ts]]]) -> tuple[Unpack[Ts]]:
return get_args(f)

ValidKey = Literal["A", "B", "C"]
valid_keys = literal_to_tuple(ValidKey) # type is ("A", "B", "C")
```

Something like this I think

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the example using typing.get_args, Literal, Unpack, TypeForm, and the proposed literal_to_tuple helper. Determine and document how SpecialForms should be interacted with, including the intended behavior and scope; the issue does not identify files, tests, or a completed design.

Written by the indexing model from the issue text.

Assessment

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