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

Pydantic et al evaluate types, and would be incompatable with a lot of based types, so: ```toml [tool.mypy] evaluated_type_bases = ["pydantic.BaseModel"] evaluated_type_decorators = ["pydantic.dataclasses.dataclass"] ```

p-1
feature
topic-configuration

```py a: object assert isinstance(a, list) reveal_type(a) # Revealed type is "list[Any]" (narrowed from "object") ``` Ideally, this should be `list[out object]` because it's invariant. but `object` at least would...

feature
topic-any

```py if TYPE_CHECKING: import x as y ``` # Workaround Add them to `__all__`

feature

https://github.com/KotlinIsland/basedmypy/pull/630#issuecomment-1907241241

needs investigation

```py from typing import TYPE_CHECKING if TYPE_CHECKING is False: asdf # reachable if TYPE_CHECKING == False: asdf # reachable if not TYPE_CHECKING: asdf # unreachable ```

```py def foo(a: int) -> str: ... @func_type[foo] def bar(): # missing parameter 'a' return 1 # expected return str, found int # OR def bar(*args: ParamSpec[foo].args, **kwargs: ParamSpec[foo].kwargs) ->...

feature

```py class A: def __init__(self): self.f = 1 print(A.f) # no error ``` HUUUHH?????

```py def foo() -> int: return exit(1) ``` This code is nonsense, yet there is no error.

make `float` not act like `float | int` (and `complex` act like `complex | float`) , and `bytes` not act like `bytes | memoryview | bytearray` we can still infer...

p-1
feature

Reified Generics in basedtyping need special casing in basedmypy. `isinstance` and `issubclass`: ```py class Foo(ReifiedGeneric[T]): ... isinstance(Foo[int](), Foo[int]) ``` Ban `TypeVar`s: ```py def foo(t: T): a: ReifiedList[T] # should be...

runtime
basedtyping