aider icon indicating copy to clipboard operation
aider copied to clipboard

Add type hints to public API functions

Open goransh-walia opened this issue 5 months ago • 3 comments

Feature Request

Summary

Adding type hints to public API functions would significantly improve developer experience and enable better tooling support.

Motivation

  • IDEs can provide better autocomplete and inline documentation
  • Static type checkers like mypy can catch bugs before runtime
  • New contributors can understand the expected inputs/outputs faster
  • Type hints serve as machine-checked documentation

Proposed Change

Add type annotations to all public functions:

# Before:
def process(data, config=None):
    ...

# After:
from typing import Optional, Dict, Any

def process(data: Dict[str, Any], config: Optional[Dict] = None) -> bool:
    ...

Additional Context

This is a non-breaking change and can be done incrementally, starting with the most-used public functions.

goransh-walia avatar Jun 30 '26 06:06 goransh-walia

Hey @goransh-buh Implemented it you can check it out

Sarthak816 avatar Jun 30 '26 17:06 Sarthak816

but isnt that a design choice of the repo? dosent contributing.md say they dont use type hints???

chrislazar25 avatar Jun 30 '26 18:06 chrislazar25

The project's CONTRIBUTING.md explicitly states under Coding Standards:

No Type Hints

The project does not use type hints.

This is a deliberate design choice by the maintainers, so this feature request contradicts the project's stated conventions. Closing this issue as per project policy - see CONTRIBUTING.md ¶ "No Type Hints".

Sarthak816 avatar Jul 01 '26 04:07 Sarthak816