| 2032 | |
| 2033 | @staticmethod |
| 2034 | def extend_inheritance(classes: dict[str, Any]) -> bool: |
| 2035 | extended_classes = {} |
| 2036 | updated = False |
| 2037 | |
| 2038 | for name, cls in classes.items(): |
| 2039 | orig_inheritance = cls.get("inheritance", set()).union(set(cls.get("bases", []))) |
| 2040 | inheritance = orig_inheritance.union( |
| 2041 | ancestor for base in cls.get("bases", []) for ancestor in classes.get(base, {}).get("inheritance", []) |
| 2042 | ) |
| 2043 | cls["inheritance"] = inheritance |
| 2044 | extended_classes[name] = cls |
| 2045 | updated = updated or inheritance != orig_inheritance |
| 2046 | |
| 2047 | return updated |
| 2048 | |
| 2049 | @classmethod |
| 2050 | def propagate_ids(cls, classes: dict[str, Any]) -> bool: |