-
Notifications
You must be signed in to change notification settings - Fork 6
Start cleaning up type annotations #24
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
| max_value=1e5, | ||
| default_value=1e3, | ||
| max_value=100000, | ||
| default_value=1000, |
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.
This surprised me, but 1e5 is a float, not an int!
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.
This look good! an optional change: if Image.Image is used anywhere else in the python image.py file, I'd prefer from PIL.Image import Image to be used, so that the type annotation can just be Image. but if the type annotation is the only place it shows up, you can leave it as it is
I see we use Image.Open in this file, it's all right to keep the annotation Image.Image
|
Rebased to fix merge conflicts. Will take one last look and then merge... |
I started looking at this due to the obvious errors in the type annotations mentioned in #23.
When I started this branch, running
mypy main.pygave 150ish errors. Between this PR and viamrobotics/viam-python-sdk#846, it's down to 100ish errors. So, there's more to do, but this is at least a start. When there are no errors, we should add another CI check that running mypy (or any other type checker, if you want something else) has no errors.