-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix or suppress MyPy errors #336
Conversation
…rited by WSRemote
All annotations need to be suppressed however, as they are seen as int
Thanks, that's a useful contribution; still looking through it. Testing locally,
I've recently dropped support for Python 3.7, 3.8 and 3.9; did you apply any workarounds to support type checking in old versions, or is that something that rather happens on the boxes of developers anyway, where a recent Python is present (and at runtime on older Pythons, type information is discarded)? |
This reverts a regression on setting per-remote-instance maximum_block_size_exp introduced in 8c8bb73.
Apart from the experiments in #347, I've pushed some more changes:
|
To summarize the current state, there are two things I'd like to do differently still:
Sorry for the delay in taking this up; are you still around and would you address those? |
The enum rework of #347 appears to work, allowing the enum definitions to themselves to stay easy -- one down. |
The one large copied list is now also verified, and I'm in the process of looking through the remaining ignores. |
... and the large swaths are fixed by overhauling typing in oscore (where this exercise actually helped find a bug). Running a few last checks, but then I think this can go in together with #347. |
This includes some non-trivial changes in how attributes are exposed and how enums are generated, none of which should have publicly observable effects unless the behavior was unreliable already. Notable changes include: * ExtensibleIntEnum types (Code, ContentFormat) are now based on Python's `enum.Enum`. * Group OSCORE: Fixed crash when attempting to use cipher suite that does not support all modes. * OSCORE contexts' `external_aad_is_group` property was replaced with subclassing `ContextWhereExternalAadIsGroup` Merges: #336 Merges: #347
Thanks for merging this pull request. Sorry for not lending a hand on finishing it up properly; I was otherwise occupied. |
As discussed in #335 the code currently does not fair well when the types are analyzed by MyPy. This pull request makes some changes so that it does pass a MyPy analysis check without errors. This would be a good starting point to start working on adding Annotations throughout the code.
Not all errors are really solved. In a few places a dynamic code style is used or there is some type confusion. These errors that could not be solved without some more refactoring are suppressed using the
# type: ignore
comment.Let me know what you think of the changes