-
Notifications
You must be signed in to change notification settings - Fork 153
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 annotations for type-specific rustworkx functions #963
Conversation
Pull Request Test Coverage Report for Build 6962670551
💛 - Coveralls |
This is ready for review, I hope it makes it to 0.14 |
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.
Overall this looks great, thanks for spending all the time to fix this. Just a couple of questions inline.
rustworkx/cartesian_product.pyi
Outdated
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.
Do we have to worry that this adding a module that doesn't exist in the rustworkx package? Like we'll have type hints for rustworkx.cartesian_product.digraph_cartesian_product
which isn't a valid path in rustworkx.
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.
The linter complains but it’s a tradeoff. I created the files to organize our code like in Rust. But in practice our Rust just becomes one big file, while Python doesn’t. I could try adding underscores in the name of the files to prevent them from being imported following PEP-8 conventions
Closes #960
Related to #352, follow up of #401
This adds type annotations to all type-specific rustworkx functions. It also re-exports all type-specific functions at the top-level, because it is unlikely that users will use
rustworkx.rustworkx
(it's a hidden implementation detail)