Skip to content

Refactor type hints to use built-in generics #18#19

Merged
sql-hkr merged 1 commit intomainfrom
refactor/type-hints
Oct 25, 2025
Merged

Refactor type hints to use built-in generics #18#19
sql-hkr merged 1 commit intomainfrom
refactor/type-hints

Conversation

@sql-hkr
Copy link
Owner

@sql-hkr sql-hkr commented Oct 25, 2025

This pull request updates type annotations across the codebase to use standard Python built-in generics instead of importing types like Tuple and Dict from the typing module. This modernizes the code, improves readability, and aligns with best practices for Python 3.9 and later. No functional changes are introduced.

Type annotation modernization:

  • Replaced all uses of Tuple, Dict, and List from the typing module with built-in generics (tuple, dict, list) in function signatures and type hints throughout the following modules: function.py, math.py, layer.py, adadelta.py, adagrad.py, adam.py, optimizer.py, dataloaders.py, rl.py, and util.py.

Cleanup of unused imports:

  • Removed now-unnecessary imports of Tuple, Dict, and List from the typing module in all affected files.

@sql-hkr sql-hkr merged commit 1d1002a into main Oct 25, 2025
1 check passed
@sql-hkr sql-hkr linked an issue Oct 25, 2025 that may be closed by this pull request
2 tasks
@sql-hkr sql-hkr deleted the refactor/type-hints branch October 25, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor type hints to use modern built-in generics (Python 3.9+)

1 participant