get_parent_argument_or_none

app.util.helpers.generics.get_parent_argument_or_none(cls: type | GenericAlias, parent: type | Iterable[type], param: ParamType, **kwargs: Unpack[GetParentArgumentKwargs]) ArgType | None[source]

Return the value or bound resolved for param on parent within cls if any.

If parent is an iterable of types, check each in order until one is found that specialises param, if any.

Raises:

GenericsError – If param cannot be resolved or violates the optional bound constraint.

Parameters:
Return type:

ArgType | None