Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decision on adopting type hints #24

Open
jhlegarreta opened this issue Sep 30, 2024 · 3 comments
Open

Decision on adopting type hints #24

jhlegarreta opened this issue Sep 30, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@jhlegarreta
Copy link
Contributor

What would you like changed/added and why?

Some parts of the coder use type hints, whereas others do not. It would be beneficial to make a decision and to keep the code consistent.

Do you have any interest in helping improve the documentation?

Yes

Do you have any suggestions for the new documents?

Adopting type hints is probably good to be able to detect errors earlier.

@jhlegarreta jhlegarreta added the documentation Improvements or additions to documentation label Sep 30, 2024
@oesteban
Copy link
Member

I'm 👍 and try to incorporate type annotations when I have the time or need to better interpret the code with the hopes that one day all the code will have type hints.

@effigies
Copy link
Member

An unchecked type hint is just a note to your future self, but it also triggers additional checks by the type checker. Adding hints without checking them just makes the task of adopting a type checker more involved.

I would suggest adopting a type checker first, add type checks to your CI (and pre-commit, if it's fast enough), and then begin annotating your project.

@jhlegarreta
Copy link
Contributor Author

Adding hints without checking them just makes the task of adopting a type checker more involved.

Didn't know that it would make the adoption of a checker more involved.

I would suggest adopting a type checker first, add type checks to your CI (and pre-commit, if it's fast enough), and then begin annotating your project.

Looks a reasonable plan. @effigies please feel free to downvote the adoption of type hints (and checkers) if you do not see any benefit to them; then it is more a decision about consistency in the code.

@oesteban oesteban transferred this issue from nipreps/eddymotion Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants