-
Notifications
You must be signed in to change notification settings - Fork 38
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 type to more util modules #1587
Conversation
|
||
def generator(rand): | ||
return rand.choice(enum_values) | ||
generator = lambda rand: rand.choice(enum_values) # noqa: E731 |
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.
@freider I added a ruff ignore here to avoid having a def
, which requires a function type signature and conflicts vs line 64.
7ad5e06
to
f0aaa9b
Compare
@freider Let me know if you have comments, thanks! |
f0aaa9b
to
939f74f
Compare
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.
Thanks!
@@ -12,6 +12,7 @@ def _update(hashers, data: Union[bytes, IO[bytes]]): | |||
for hasher in hashers: | |||
hasher.update(data) | |||
else: | |||
assert isinstance(data, IO) |
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.
Odd that this is necessary!
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.
It turns out to be microsoft/pyright#5697
Also this broke our CI once it landed which is weird because it looks like it passed on the branch 🤔
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.
@mwaskom My bad for delay, had been deep in interview-land 😅
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.
No worries, I got to learn some interesting stuff about typing edge cases :D
Describe your changes
This PR adds mypy types to more
_utils
modules, as per #1372.