alibaba / alibaba/ROLL

[Type Hints] Add type annotations to utility functions in roll/utils/functionals.py

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.4k
Forks
312
Avg merge
1h 2m
Merged PRs (30d)
2

Description

## Description
The `roll/utils/functionals.py` file contains many utility functions missing type annotations. This tracks the effort to add complete type hints.

## Current State
- ~30+ functions missing complete type annotations
- Some docstrings in Chinese

## Proposed Phases
1. **Phase 1**: Simple functions (no existing type hints)
2. **Phase 2**: Add return types to partially annotated functions
3. **Phase 3**: Complex functions with custom types

## Benefits
- Better IDE support and autocomplete
- Improved documentation
- Easier maintenance with type checking
- Consistency with CLAUDE.md standards

## Related
Aligns with CLAUDE.md: "Type hints required for all code"

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading roll/utils/functionals.py and the type-hint requirement in CLAUDE.md. Begin with Phase 1's simple functions, then review partially annotated and custom-type functions as described; the work is done when the utility functions in that file have complete type annotations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.