تخطَّ إلى المحتوى

Missing type annotation (ARCH2193)

هذا المحتوى غير متوفر بلغتك بعد.

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.