Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR performs a long-awaited pyright update & fixes all of the issues that have accumulated over time.
The most notable change here is to the
pinger.py
andquerier.py
files, where the old classes were turned into data-classes, with a new base class, to better handle the weird sync -> async inheritance. This approach still requires type ignores in the method overrides, but it is a lot more sensible and clean.Note that I've added a
"disableBytesTypePromotions": false
pyright setting, which was newly introduced (well, at least newly compared to the version we're updating from) and re-introduces the old technically type-incorrect approach that treatsbytearray
as a subtype ofbytes
. It would be possible to fix this instead, but it would affect a lot of the existing code. If desired, this can be done at later time.Finally, on top of just the necessary changes to make pyright pass, I have made a few slight improvements to typing in some places, these are generally very minor.
Superseds & closes: #923