(typ)
| 739 | bases = set(cls.__mro__) |
| 740 | # Remove entries which are already present in the __mro__ or unrelated. |
| 741 | def is_related(typ): |
| 742 | return (typ not in bases and hasattr(typ, '__mro__') |
| 743 | and not isinstance(typ, GenericAlias) |
| 744 | and issubclass(cls, typ)) |
| 745 | types = [n for n in types if is_related(n)] |
| 746 | # Remove entries which are strict bases of other entries (they will end up |
| 747 | # in the MRO anyway. |