KotlinIsland / KotlinIsland/basedmypy
Allow shorthand `[T]` for `list[T]`, `{T}` for `set[T]`, and `{K: V}` for `dict[K, V]`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
There's already `(T, U, V)` for `tuple[T, U, V]` and I think what I wrote is all valid syntax, so I think these shorthands are kind of the obvious way to write these types.
```python
xs: [int] = [3, 6, 1]
def f() -> {float}:
return {4.5, 7.2}
def g(d: {str: int}):
print(d)
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by tracing the implementation of the existing `(T, U, V)` tuple shorthand through parsing and type analysis, then determine where the proposed list, set, and dict forms would be handled. Done means the examples in the issue parse and type-check with the intended types, with coverage for valid and invalid uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100