Skip to content

Rules

invalid-overload-implementation

Default level: error.

What it does

Checks for invalid overload implementation.

Why is this bad?

Invalid overload implementation can lead to runtime errors.

Examples

from typing import overload

@overload
def foo(x: int) -> str: ...
@overload
def foo(x: str) -> int: ...
def foo(x: int | str) -> int | str:
    return x

foo("1")

See more

typing-any-used

Default level: error.

What it does

Checks for usage of typing.Any in type annotations.

Why is this bad?

Using typing.Any in type annotations can lead to runtime errors.

Examples

from typing import Any

def foo(x: Any) -> Any:
    return x + 1

foo("1")

See more