[BUG] minor typing.ClassVar
fix for class variables of Index
#5189
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.
PR Summary
Context: To annotate the types of class variables, you need to wrap the type using the
typing.ClassVar
construct. If the class-variable has typeT
, the type should be annotated astyping.ClassVar[T]
. If you don't use this construct, python assumes that it is an instance variable..Overview: This PR rectified started using the
typing.ClassVar
construct to wrap the type annotations for the_unsupported_objects
and_index_properties
class variables ofIndex
.A quick aside
A quick grep showed that
GridGeometryHandler
is the only class to actually define_index_properties
, and there isn't any code that examines this attribute. Can we delete it? If we want to keep it as an attribute ofGridGeometryHandler
for posterity, can we delete class attribute fromIndex
. If there is interest in doing this, I will happily open another PR