KotlinIsland / KotlinIsland/basedmypy

type-time static `StaticPath` types

Open
#436 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Checking if files exist statically would be useful
```py
a: StaticPath["foo.txt"] = Path("foo.txt") # error: file doesn't exists
```

Expanding on this we could even statically get the content of the files:
```py
a: StaticPath['foo.txt']
reveal_type(a.read_text()) # "Hello, World!"
```

Contributor guide

Open the contributing guide

Research direction

The issue names no implementation files, tests, or entry points. Start by locating the StaticPath and static file-checking type-analysis code, then establish the intended behavior for missing files and inferred read_text() content. Done should include a decided design and tests covering the proposed examples.

Written by the indexing model from the issue text.

Assessment

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