Skip to content
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

Introduce mypy for static analysis and fix some bugs that mypy revelaed #960

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vadim2404
Copy link

The idea is to add static code analysis for the code to catch bugs earlier and help engineers with type hinting in the IDEs they use.

Copy link

@breakid breakid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed all of the code changes, and everything looks good to me. The changes are mostly adding type hints, plus some minor optimizations such as using f-strings and converting some elif blocks to guard statements, which are a bit cleaner.

The only logic change I saw was the following from the append() method in the Edge class, which appears to be a bug fix, but which I wanted to highlight in case someone more familiar with the code base knows of any unintended side effects this might cause.

o.reverse = forward if forward else o.reverse -> o.reverse = reverse if reverse else o.reverse

I'm looking forward to these changes being merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants