basedmypy
basedmypy copied to clipboard
Based Python static type checker with baseline, sane default settings and based typing features
lib authors won't be able to use this at all if it has breaking changes, so add a `lib` mode that is compatible with mypy. Honestly this sounds very unbased.
Most of this can be done in basedtyping except mypy error in `isinstance`. As the based implementation is now a `type` not an instance, it's valid to use in `isinstance`...
`type` has a lot of whackyness, this issue can collect all the strange things it does. ```py a = type # error: Expression type contains "Any" (has type "type[type]") [misc]...
### Describe the problem, ie expected/actual result (if it's not blatantly obvious) _No response_ ### Gist to reproduce ```python Foo = Intersection[int, str] foo: Foo # error: invalid type ```
### Describe the problem, ie expected/actual result (if it's not blatantly obvious) _No response_ ### Gist to reproduce ```python from __future__ import annotations from typing import TypedDict class Foo(TypedDict): a:...
```py a = [1] b: list[Out[object]] = a # no error ``` ```py class A(Generic[T]): def foo(self, t: T): ... def foo(a: A[out[int]]): a.foo(0) # error foo(A[bool]()) # no error...
```py def f() -> list[object]: r = [1] reveal_type(r) # list[object] return r ```
### Describe the problem, ie expected/actual result (if it's not blatantly obvious) ``` AttributeError: attribute '__isabstractmethod__' of 'property' objects is not writable ``` ### Gist to reproduce ```python from abc...
idk what it's called? 'GitHub code scanning' maybe?