basedmypy
basedmypy copied to clipboard
Based Python static type checker with baseline, sane default settings and based typing features
```py def f(f: type[T]) -> T: ... reveal_type( # int | str f(int | str) # error: This is a `TypeForm` not a type ) ```
```py a = reveal_type({ # Revealed type is "dict['C' | 'D', None]" "A": None, "B": None, "C": None, "D": None, }) reveal_type(a) # Revealed type is "dict[str, None]" ```
```py class A: a: Final[int] b: TypeCheckOnly[str] class A2(A): a: Final[bool] class B[T: A]: c: T.a b: B[A2] reveal_type(b.c) # bool ```
```py function # no error ```