get_bases_between_or_none

app.util.helpers.generics.get_bases_between_or_none(cls: type | GenericAlias, parent: type, result: list[type | GenericAlias] | None = None) list[type | GenericAlias] | None[source]

Return the inheritance chain between cls and parent, inclusive.

If cls is not a subclass of parent, return None.

Raises:

GenericsError – If cls is not a subclass of parent or the chain includes non-generic components that cannot be inspected.

Parameters:
  • cls (type | GenericAlias)

  • parent (type)

  • result (list[type | GenericAlias] | None)

Return type:

list[type | GenericAlias] | None