Why this matters
Type annotations improve the maintainability and readability of code and help catch type-related errors during development.
Ensure that functions in public APIs include type annotations. Type annotations improve code clarity and help catch type-related errors early. Recommend adding them where missing.
Type annotations improve the maintainability and readability of code and help catch type-related errors during development.
Side-by-side examples engineers can pattern-match during review.
def add(a, b):
return a + bdef add(a: int, b: int) -> int:
return a + bdef add(a, b):
return a + bdef add(a: int, b: int) -> int:
return a + bFrom the same buckets as this rule.