Skip to content

Conversation

mabruzzo
Copy link
Contributor

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 type T, the type should be annotated as typing.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 of Index.

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 of GridGeometryHandler for posterity, can we delete class attribute from Index. If there is interest in doing this, I will happily open another PR

@neutrinoceros
Copy link
Member

there isn't any code that examines this attribute. Can we delete it?

yes, I don't see why not, this seems like a clear case of dead code. Thanks for finding it !

@matthewturk
Copy link
Member

I vaguely remember it having a need at one point and possibly being replaced by something else -- maybe even the supported objects.

@mabruzzo
Copy link
Contributor Author

I removed the dead-code. It's ready for you guys to take another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants