improve type hints for notify/indicate subscriber(s) methods#915
Merged
barbibulle merged 1 commit intogoogle:mainfrom Apr 27, 2026
Merged
improve type hints for notify/indicate subscriber(s) methods#915barbibulle merged 1 commit intogoogle:mainfrom
barbibulle merged 1 commit intogoogle:mainfrom
Conversation
e64d360 to
f8953cd
Compare
Pyright expects generic type parameters to be specified for the Attribute class, otherwise it treats the type as Unknown which can trigger reportUnknownMemberType errors. This can be solved by using a generic type parameter for these methods which also has the benefit of making sure that the value parameter has the correct type for the attribute. In some cases, a new local `value_as_bytes` variable is needed to avoid type errors and makes the code less confusing by not overwriting the original `value` variable.
f8953cd to
baa5257
Compare
Contributor
Author
|
Updated to fix failing CI (passing |
barbibulle
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pyright expects generic type parameters to be specified for the Attribute class, otherwise it treats the type as Unknown which can trigger reportUnknownMemberType errors.
This can be solved by using a generic type parameter for these methods which also has the benefit of making sure that the value parameter has the correct type for the attribute.