basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Based Python static type checker with baseline, sane default settings and based typing features

Results 446 basedmypy issues
Sort by recently updated
recently updated
newest added

```py from typing import TYPE_CHECKING if TYPE_CHECKING: import sys sys # expect error: sys is imported as type only ``` - related #166 It's kinda a half measure of fixing...

```py def f(t: TypeExpr[T]) -> T: ... reveal_type(f(int | str)) # int | str a: TypeExpr[int | str] a = int | str # valid UnionType a = int #...

feature
basedtyping

```py def g(x: object) -> "x is list[Any]": return True async def f(t: list[int] | int): if g(t): return reveal_type(t) # list[int] | int, expected int ```

TypeGuard

```py from typing import * class A: a: ClassVar[Callable[[int], None]] A().a(1) # too many arguments ``` This is absolute nonsense

feature

```py from __future__ import annotations from typing import * from types import FunctionType fn1: Callable[[], None] reveal_type(fn.__name__) # expect error fn2: Callable[[], None] & FunctionType reveal_type(fn.__name__) # expect 'str' ```...

p-1
understandability

Needs some more thought, but: # Well ```py class A: a: Callable[[int], str] = lambda x: "" A().a(1) # no type error ``` # So ```py from __future__ import annotations...

feature

```py class A: pass class D(A): def __get__(a, b, c): return None # no error class C: d: A = D() reveal_type(A.d) # A, at runtime it will be None...

### Describe the problem, ie expected/actual result (if it's not blatantly obvious) _No response_ ### Gist to reproduce ```python # mypy: enable-error-code=redundant-expr if isinstance(1, str): # no error ... b...

bug
upstream