KotlinIsland / KotlinIsland/basedmypy
An `Exact` annotation modifier
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
```py
class A: ...
class B(A): ...
def f(a1: Exact[A], a2: A):
a1 or 1 # error
a2 or 1 # no error
f(A(), A())
f(B(), B()) # error: expected A
```
```py
class A(Generic[T]):
def __init__(t: Exact[T]): ...
A[int](1) # ok
A[int](True) # error
```
```py
def test(a: T, b: Exact[T]): ...
o: object
test(o, "a") # error, expected exactly 'object' found 'str'
```
Contributor guide
Research direction
The issue names no repository files, tests, or entry points; begin by tracing how annotations and generic argument compatibility are checked. Use the three examples as acceptance cases, including rejecting subclasses and incompatible inferred types.
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
- Mostly clear
- Newbie friendliness
- 25/100