Closed dawsonbooth closed 3 years ago
Awesome work! I haven't reviewed the PR in depth yet, but it looks good so far. I haven't used PEP 526 annotations before, so I need to look into a few things before merging.
You don't necessarily have to answer all of the questions I'm about to list, or address them in your PR. I'll investigate them as I have time, but any insight you can offer would be very welcome.
:py:class:`DashBack`:
, etc). I vaguely recall looking into this without success back when I started py-slippi, but things may have changed since then. I would also be open to other tools than Sphinx.__slots__
too? Not that important, but it would be a sweet bonus.To address your questions:
I use VSCode for most of my Python work, so while I imagine it's useful for all IDE's, I really only understand the benefits therein. The two main features this provides for this IDE is an indication of the parameter types for any given function and auto-complete for the attributes of any given class. Here are a couple of screenshots:
I've never used the tool, but this package gives some insight into using PEP 526 annotations with autodoc and Sphinx.
See above
Not sure if there's a true Pythonic way of doing this, but this tool happens to exist for that purpose.
The mypy type checker is an optional static type checker that can run as part of your unit tests or development workflow.
Just pushed a few commits to address your comments. I believe I made all the changes you requested. I see what you mean about the parse function -- mypy's apparent issues with the union type are explained decently here in their docs.
Thanks for addressing my comments. I merged your PR into this branch for some additional changes; I hope to merge that into master within the week.
Thanks again for the great work!
Thank you for this awesome package!
This PR adds type annotations to all public classes and functions. In essence, each variable that already has a type comment has been given an official, Pythonic type annotation according to PEP 526.
PEP 526 further establishes that "Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention." As such, this PR should not affect package's performance or functionality beyond improving the developer experience. That said, I feel I should add that all tests are passing!
I'm relatively new to open source collaboration, so my apologies if something I've done here isn't entirely kosher.
Thanks again for your work on this package! Feel free to let me know of any concerns.