basedmypy
basedmypy copied to clipboard
Based Python static type checker with baseline, sane default settings and based typing features
```py from types import FunctionType def f(): pass f: FunctionType = f # error: expected FunctionType, found Callable ```
```py # third_party.py def foo() -> Any: ... ``` ```py # my.py some_list: list[int] = third_party.foo() # that's okay? ```
Something like a mapping declaration This would enforce that any module/file that meets that filter must meet the specified type. ```py from basedtyping import module_type_map module_type_map({ "pages.*": PageType, "apis.*": APIType,...
the current behavior leads to confusion and annoying behavior from pip, especially when trying to switch between normal mypy and basedmypy ``` > pip install mypy==0.910 Requirement already satisfied: mypy==0.910...
```py a: Any reveal_type(a) ``` ``` > mypy test.py test.py:2: error: has type "NotChecked" ```
### Describe the problem, ie expected/actual result (if it's not blatantly obvious) Basedmypy isn't able to handle baseline matching when being run with a different working directory. ``` C:\myproject>mypy ....