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 def guard(x: object) -> x is int if True else x is str: ... def guard(x: object) -> True if True else x is str: ... ``` likely a...

feature
TypeGuard

# unions ```py def guard(a: object, b: object) -> a is int | b is int: ... a: object b: object if guard(a, b): reveal_type((a, b)) # (object, object) c:...

feature
TypeGuard

```py assert 1 # expect error ```

p-1
feature
strict-equality

If we could somehow inspect the implementation and determine if it is a 'full typeguard', or just a 'positive typegaurd' ```py def is_positive_int(val: int | str) -> TypeGuard[int]: return isinstance(val,...

feature
p-3
topic-inference
TypeGuard

- utilize the baseline `target` - don't update offsets if they are within a range - base offsets on the targets offset

feature
basedline

```py from typing import overload, Self class A: @overload def __new__(cls, a: int): ... @overload def __new__(cls, a: str, /): ... def __new__(cls, a: int | str): return super().__new__(cls) #...

bug
topic-inference

```py from datetime import date a: date if a == "a": # no error print("hi") ``` This issue is that operators tend to be implemented like: ```py class A: def...

feature

incorrect: ```py def foo(): a: str = 1 # type: ignore[assignment] # error: add a comment on the line above explaining why the error is being ignored ``` correct: ```py...

feature

```py a: int | None a = None for _ in range(2): reveal_type(a) # None a = 1 ``` `a` should be widened to `int | None` at the start...

p-1
feature