Add type annotations to AnimePlanet.py #76
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a little bit of extra time this evening, so I thought I'd take a crack at addressing a trivial part of #52. This just adds type annotations for
roboragi/AnimePlanet.py
and puts some knownmypy
files into the.gitignore
.There were a few types that seemed ambiguous that I guessed at (like the
animeId
andmangaId
arguments which come from a table in the SQLite database that I don't think has an explicit schema) and theauthorName
variable, which I don't think is actually used by any calling code. If I've erred in assessing those types just let me know and I can adjust.I should also note that in contrast to #75, this only adds type annotations on function signatures. I'm not sure if you'd prefer to add them everywhere, but I'll be happy to adjust that to your preference as well, @Nihilate. Myself, I tend to only add them on the function signatures and where there's ambiguity that
mypy
complains about.Running
mypy
againstroboragi/AnimePlanet.py
after these changes