-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add hints for parameters and return values! #102
Comments
what is your recommendation ? |
I personally always use type annotations in my code, as it generally improves IDE support (suggestions, errors). |
ok then, I will start addressing this issue then. |
I agree. In the medium term, I think we should also add mypy to the linters as it can easily detect some type errors (I just ran it manually and it found two mistakes that can be easily overlooked by humans, even with the limited type hinting currently present in the codebase) |
(or maybe flake8 has a type checking plugin, I don't have a strong preference for a specific tool, just type checking in general) |
flake8 doesn't do much on its own, it delegates the heavy work to other existing tools. There is a plugin for mypy as well, but I think it's better to use mypy directly. That one really only exists as a workaround for editors that have integrated flake8 support but no integration for mypy. |
It appears the discussion has a relatively clear outcome (so I changed the title of the issues). It seems, clear we should do it, but it is not a top-priority right now. However, we should probably add this as requirement for new commits. |
@ffl096 do you have updates on this? Should we close it? |
This is an ongoing effort and will be automatically closed once #163 is merged. The remaining issues are non-trivial and will take more time. |
@ffl096 when will you expect this to be completed? |
@ffl096 should we close this task ? |
See #163. |
TopoNetX for the most part does not use type hints for function parameters and return values, which would be usable by static type checkers such as mypy (in TopoNetX itself but also when consumers want to check their code for errors).
However, recently, some comments by @josefhoppe added a few type hints to the source code, e.g., in #94. I think there should be a clear decision whether to add type hints or not:
Either way, the decision should be made clear in the contribution guidelines and enforced for new pull requests.
The text was updated successfully, but these errors were encountered: