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 __future__ import annotations from typing import Literal, assert_never foo: 1 | 2 if foo == 1: ... elif foo == 2: # error: redundant-expr ... else: assert_never(foo) ```...

improvement
p-2
strict-equality

```py @overload def f(a: None) -> TypeError["Can't be None"]: ... @overload def f(a: object): ... ``` If we want that overload to be invalid, should it be a decorator instead...

feature

```py dict[str, int] class Type(MappedType): name: str dict[Type.Key, Type.Value] ``` I don't know how to solve `__delitem__`/`clear` yet, but it would be something to do with it's signature indicating that...

feature

```py a: "(int, str)" # error: invalid type comment or annotation ```

bug

Currently the stubs are wrong and say it's just an alias to a special form in `typing`. Which is absolute nonsense, because it isn't a `_SpecialForm` at all

feature

```py class A: def __init__(self): ... class B: def __init__(self, i: int): ... a: type[A] = B a() # no error ``` This is absurd What if we removed the...

feature

```python from typing import Callable, cast, TypeGuard # mypy: disallow-any-explicit=false value: object if callable(value): cast(Callable[[], None], value) # error: non overlapping cast # if we copy its signature from typeshed,...

bug
good first issue

```py @public def f(): ... @internal def g(): ... ``` and so on and so forth.

feature

```py if TYPE_CHECKING: a = 1 # no corresponding real definition print(a) ``` Of course this doesn't facilitate all usages: ```py if TYPE_CHECKING: from _typedshed import SupportsAmongUs a: SupportsAmongUs #...

feature

```py if TYPE_CHECKING: a: 1 | 2 # no errors def f(self, a: A): ... # no errors class A: ... ```

feature