Aller au contenu

Missing type annotation (ARCH2193)

Ce contenu n’est pas encore disponible dans votre langue.

Key python.quality.missing-type-hint · Severity info · Category quality

Missing type annotations on public APIs weaken static analysis and editor support. Annotate parameters and return types.

def discount(price, rate):
return price * (1 - rate)
def discount(price: float, rate: float) -> float:
return price * (1 - rate)

Add type annotations to public function parameters and return values.