Skip to content

Add type hints to public API functions #64369

Description

@goransh-buh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-backlogcoreIssues that should be addressed in Ray CoredocsAn issue or change related to documentationusability

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions