-
Notifications
You must be signed in to change notification settings - Fork 16
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
Type hints for functions #281
Comments
Just to clarify, by type hints do you mean adding unit annotations to the inputs and outputs or add type hints for the data types of the inputs and outputs (eg I ask because I'm all in favor of the former, but I'm very wary of the latter. |
Both. Why are you wary of the latter? |
I find the addition of type hints/annotations makes Python code more cluttered and less readable. The value added by having these annotations does not seem to justify the cost. However, I recognize this is largely personal preference and I recognize I'm increasingly in the minority. If you find it helpful, it's worth considering. Did you have a particular function/method in mind where this would be useful? |
I don't have particularly strong opinions one way or other, so I'm not going to push about it. Certainly units would be helpful though. I was looking at the ion collections (thinking of working on #232) and noticed that the functions there are missing type hints. E.g. Line 83 in 83eb4d2
Lines 213 to 214 in 83eb4d2
|
The return statements in functions in fiasco can be quite varied, both in terms of the units and the data types/structures. There are still a good number of functions without type hints, so I think it might be worth going through and adding type hints to improve readability of the code.
Any thoughts?
The text was updated successfully, but these errors were encountered: