basedmypy
basedmypy copied to clipboard
Based Python static type checker with baseline, sane default settings and based typing features
```py # python3.8 a: "list[int]" # error: "list" is not subscriptable, use "typing.List" instead cast("list[int]", []) # valid cast(List["list[int]"], []) # error ``` `cast` has inconsistent behaviour because I think...
```python from typing import Generic, TypeVar from basedtyping import T class Foo(Generic[T]): ... U = TypeVar("U", bound=Foo[T]) class G(Generic[T]): ... class C(G[tuple[U, T]]): ... # error: Value of type variable...
among us: - [ ] #467 - [ ] #111 - [x] #479 - [x] #473 - [ ] #286 - [ ] #432 - [ ] #449 - [x]...
this would clash with `default-return`, so would need a committee meeting to discuss.
```py a: bool | None if not a: # error: the type of 'a' contains "None" and could be a mistake to check it in a boolean context ... ```...
[I think there's a website that has the spec](https://no-color.org/)
```py class A: a: object class B(A): a: int a: A a = B() reveal_type(a.a) # N: Revealed type is "int" # Actually expected N: Revealed type is "int" (narrowed...
```py a: list[Any] = [] a.clear() # expect no error a # expect error ```