pure: add an "abstractmethod" and some type hints to parsers.py to help pytype
It looks like `BaseIndexObject` is meant to be a base class with common implementation across the subclasses. Both subclasses provide the class attrs typed here, as well as `_calculate_index()` that are accessed by the base class. The trick is, `revlog.RustIndexProxy` also uses it as a base class, and forwards some methods such that it doesn't want or need this method. This is kind of a workaround to keep everything happy. Likewise, it doesn't need the 3 class variables, because it overrides the methods in this class that use them. But there's no way to conditionally declare these. Their presence seems conditional on the version of Python- see 199b0e62b403. (Also, it looks like the rust class doesn't override `append()`, which would need `_extra`. Not sure if this is an oversight, or if it's more of a "protected" field instead of private.) `PersistentNodeMapIndexObject` says it's for debugging, so I'm not going to bother trying to figure out what the 3 required class attr types are right now, and risk introducing a cycle that confuses pytype.
parent
1b9b6b4a
No related branches found
No related tags found