Describe the bug
The core component _get_class_flags iterates over reversed(inspect.getmro(cls)[:-2]). The arbitrary [:-2] cut off removes the last two members of the object tree. In multiple-inheritance situations (e.g., class CustomAlgorithm(BaseObject, ArbitraryMixin)), ArbitraryMixin slides against the end index of the MRO. Consequently, its associated _tags and _flags properties get unconditionally deleted out of get_class_flags.
To Reproduce
import inspect
from skbase.base import BaseObject
class MyMixin:
_tags = {"mixin_tag": "should_be_seen"}
# With multiple inheritance
class MyObj(BaseObject, MyMixin):
_tags = {"obj_tag": "seen"}
tags = MyObj.get_class_tags()
print("Tags:", tags) # mixin_tag will be missing completely from the output due to the [:-2] slice logic
Expected behavior
Tags defined in all class ancestor mixins should be exposed regardless of multiple inheritance order or length (except for Python's base object which never contains flags).
Proposed Fix
Revert to iterating through the getmro() resolution tree entirely natively while explicitly discarding object rather than generic indices:
for parent_class in reversed(inspect.getmro(cls)):
if parent_class is object:
continue
# ... check hasattr
Describe the bug
The core component
_get_class_flagsiterates overreversed(inspect.getmro(cls)[:-2]). The arbitrary[:-2]cut off removes the last two members of the object tree. In multiple-inheritance situations (e.g.,class CustomAlgorithm(BaseObject, ArbitraryMixin)),ArbitraryMixinslides against the end index of the MRO. Consequently, its associated_tagsand_flagsproperties get unconditionally deleted out ofget_class_flags.To Reproduce
Expected behavior
Tags defined in all class ancestor mixins should be exposed regardless of multiple inheritance order or length (except for Python's base
objectwhich never contains flags).Proposed Fix
Revert to iterating through the
getmro()resolution tree entirely natively while explicitly discardingobjectrather than generic indices: