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 known mypy files into the .gitignore.
There were a few types that seemed ambiguous that I guessed at (like the animeId and mangaId arguments which come from a table in the SQLite database that I don't think has an explicit schema) and the authorName 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 against roboragi/AnimePlanet.py after these changes
[19:29:10] venv:(roboragi) tucker@khanti:~/Projects/Roboragi git:(enhancement/type-annotations) § mypy roboragi/AnimePlanet.py
Success: no issues found in 1 source file
[19:29:20] venv:(roboragi) tucker@khanti:~/Projects/Roboragi git:(enhancement/type-annotations) §
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