[BUG] minor typing.ClassVar fix for class variables of Index#5189
Open
mabruzzo wants to merge 2 commits into
Open
[BUG] minor typing.ClassVar fix for class variables of Index#5189mabruzzo wants to merge 2 commits into
typing.ClassVar fix for class variables of Index#5189mabruzzo wants to merge 2 commits into
Conversation
Member
yes, I don't see why not, this seems like a clear case of dead code. Thanks for finding it ! |
Member
|
I vaguely remember it having a need at one point and possibly being replaced by something else -- maybe even the supported objects. |
Contributor
Author
|
I removed the dead-code. It's ready for you guys to take another look |
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.
PR Summary
Context: To annotate the types of class variables, you need to wrap the type using the
typing.ClassVarconstruct. 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.ClassVarconstruct to wrap the type annotations for the_unsupported_objectsand_index_propertiesclass variables ofIndex.A quick aside
A quick grep showed that
GridGeometryHandleris 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 ofGridGeometryHandlerfor posterity, can we delete class attribute fromIndex. If there is interest in doing this, I will happily open another PR