Add type hints for type safety
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 150
- Forks
- 23
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Description
Add type hints across the codebase. They are valid syntax for Python v..3.5+, so are safe to add given we are now 3.7+.
We can then use type checking tools, such as mypy, to ensure robustness of our code and catch bugs relating to errors due to incorrect types.
See https://github.com/NCAS-CMS/cf-python/pull/785#discussion_r1638434210 for brief further discussion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the Python codebase alongside PEP 484 and the brief discussion in PR #785, then identify the scope of annotations needed across the project. Consider how mypy would be applied to check the new hints. Done means the codebase has appropriate type hints and can be checked for type-related errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100