You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In h5py, `h5py.File` is a subclass of `h5py.Group`. Multiple inheritance is ugly but there is some code shared between `LindiH5pyFile` and `LindiH5pyGroup` that *I think* could be simplified by having `LindiH5pyFIle` inherit also from `LindiH5pyGroup`.
The text was updated successfully, but these errors were encountered:
magland
changed the title
Considure making LindiH5pyFile a subclass of LindiH5pyGroup
Consider making LindiH5pyFile a subclass of LindiH5pyGroup
Apr 4, 2024
I think* could be simplified by having LindiH5pyFIle inherit also from LindiH5pyGroup
Just a note of caution, since both h5py.File and LindiH5pyGroup inherit from h5py.Group this would result not just in a simple multiple inheritance, but actually in a diamond inheritance pattern.
This pattern can lead to ambiguity in method and attribute resolution. This can certainly be done, but is something that should be done with great care.
Alternatively, since LindiH5pyFile already inherits from h5py.Group, would it be possible to factor out shared code from LindiH5pyGroup into utility functions that can be used in both places to avoid multiple inheritance?
Or if that doesn't work, would it be possible to factor out shared code in another class, e.g., LindiGroupBase (that would not have another base class). This would then still require multiple inheritance, since then LindiH5pyGroup would inherit from both h5py.Group and LindiGroupBase and LindiH5pyFile would inherit from h5py.File and LindiGroupBase, but it would avoid diamond inheritance.
Originally posted by @rly in #28 (comment)
The text was updated successfully, but these errors were encountered: