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

Like `TypedDict` but based. - Support any `Mapping` including a covariant version of `dict` - Usable as a type parameter on functions unrelated to maps - Support any key type...

feature

```py def f(x: object) -> TypeGuard[int]: ... a: object result = f(a) reveal_type(a) # object assert result reveal_type(a) # int ``` ```py def f(x: object) -> TypeGuard[int]: ... def run(fn:...

feature
TypeGuard

```py foo: bool = True if foo is True: # error ... ``` ```py x: bool | None if x == True: # redundant ... if x == False: #...

feature

An option to unionize the duck types. ```py a: float reveal_type(a) # float | int ``` I think a configuration option like `duck_types` with values of `unionize`, `plain`(#167) and `standard`...

feature

https://kotlinisland.github.io/basedmypy/command_line.html#cmdoption-mypy-extra-checks > This flag enables additional checks that are technically correct but may be impractical in real code. In particular, it prohibits partial overlap in `TypedDict` updates, and makes arguments...

feedback

Perhaps intersections will be among *them*!

topic-intersection

```py class MyPlugin(Plugin): default_error_code = ErrorCode("my-code", "", "") @hook_function(mypackage.mymodule.mydef) def _(self, ctx: FunctionContext): if isinstance(ctx.arg_types[0][0], NoneType): self.fail("epic fail") ``` We can wrap up hook functions with a nice decorator, have...

feature

### Describe the problem, ie expected/actual result (if it's not blatantly obvious) ``` TypeError: Foo.foo() takes 0 positional arguments but 1 was given ``` ### Gist to reproduce ```python from...

bug

```py class A: def __str__(self): ... # don't expect error class B(A): def __str__(self): ... # expect error ```

feature

Or just refactor it out.

project