-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix add typehint without generic #507
Fix add typehint without generic #507
Conversation
@phi-friday, I haven't forgotten your PRs. I will review once #509 and #510 are merged to prevent any conflict on the |
8b3e868
to
0a694e8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #507 +/- ##
==========================================
- Coverage 96.19% 95.89% -0.30%
==========================================
Files 10 11 +1
Lines 867 877 +10
==========================================
+ Hits 834 841 +7
- Misses 33 36 +3 ☔ View full report in Codecov by Sentry. |
5d3f145
to
b340e6c
Compare
b340e6c
to
84e2831
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably not too qualified to judge this PR. I left some comments where I noticed specific things, but overall it looks good to me :)
I noticed, that since |
As far as I know, this is not possible. Let's see what we can do. However, the link was not created on |
I've seen it happen with types in docstrings, but not with type hint types (?). But yes, it does seem to behave non-reliably there, though if there are no docstring types, the docs generator will take them from the hints -- so at some point in the future we could remove type specifications from docstrings and just work with the typhints. |
I fixed some issues using |
Hey @phi-friday, after thinking about it, the goal for this PR (to me) is to add the types, as you did, and ideally have the signatures as rendered in the docs linked and looking pretty. Anything else is out of scope and should not hold up the merging of this PR, i.e. let's worry about the docstrings later. I don't think we need to overdo it. Long-term, I would ideally like to have all docstrings without types and let sphinx render them based on the type signature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another set of comments. If I understand correctly, you mainly relied on the docstrings to make the type annotations. Since they were sometimes a bit carelessly written, I will take some time and thoroughly check that the type hints are correct when I get a chance. Apologies for this PR taking so long.
Thanks for the PR! |
related: #493
I didn't use the generic and added type hints using primitive types in most cases.
Therefore, I ignored some types with
Any
.I also ignored some errors from the static type checker.
Hopefully, this will provide a better IDE experience than before.