-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Resolve some 'mypy' errors #5282
Conversation
Updated to account for merge conflicts. |
Many remaining mypy errors are from |
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.
Love this, thank you. Just one small comment
'typing.Never' was introduced later, and 'typing.Type' was used instead of just 'type' until 3.9. This commit will likely be reverted over time as these 3.8 etc. get dropped.
In changing the implementation of the 'AttrDict' class to eliminate 'mypy' errors, I had accidentally removed support for storing 'None' values in the dict. This commit restores support for them.
Apparently Python 3.8 does not support generic type parameters on the built-in 'queue.Queue' type?
I had misinterpreted the pattern type for this query to be 'NoReturn', thinking that it accepted no pattern at all (even so, I should have typed it as 'None'). However, it does accept a pattern, and uses it to decide whether to select only singletons or none at all. See <beetbox#5282 (comment)>.
I don't think this PR needs a changelog entry, but please confirm if so. |
Nah I don't think the changelog entry is needed! |
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.
Looks great, thank you!
Description
I noticed that some development work was waiting on cleaner
mypy
runs, so I thought I would help out a bit. This PR just contains a number of miscellaneous fixes across the codebase that I hit. I'm happy to add more, or remove any problematic changes (though I don't think I've broken anything, only type annotations have changed).To Do
DocumentationTests