-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
adding static type checking to basic_binary_tree.py #2293
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
Conversation
Another fellow type hinter! That's awesome @kanthuc |
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.
Let's focus our type hints on function parameters and return values unless mypy says it needs a type hint. We do not want too much typing clutter. If mypy can interprate the type from the context then we whould not repeat if because it slows down the reader. Too much typing information is clutter.
Why not automate this process of adding typing?
https://mypy.readthedocs.io/en/stable/existing_code.html#automate-annotation-of-legacy-code
Hey @kanthuc, TravisCI finished with status TravisBuddy Request Identifier: 1f45aa20-db4f-11ea-bc40-19e33457b5db |
Hey @kanthuc, TravisCI finished with status TravisBuddy Request Identifier: 15deadb0-db90-11ea-bc40-19e33457b5db |
* adding static type checking to basic_binary_tree.py * Add static type checking to functions with None return type * Applying code review comments * Added missing import statement * fix spaciing * "cleaned up depth_of_tree" * Add doctests and then streamline display() and is_full_binary_tree() Co-authored-by: Christian Clauss <[email protected]>
Describe your change:
Adding static typing to basic_binary_tree.py towards issue #2128. If my changes are correct, I'll work on changes to more files
Checklist:
Fixes: #{$ISSUE_NO}
.