What's needed?
It is difficult to use the current targets, defined as TargetComponents = list[int] | list[ComponentCategory], because the match statement (and isinstance() can't deal with containers, so we can check that something is a list but not that is a list[int]. We had issues in the past getting this right and we still do.
Proposed solution
Wait until this is implemented in the client:
And then use the same solution here.
Use cases
No response
Alternatives and workarounds
No response
Additional context
This is mostly a reminder that we should update this library and the DispatchInfo class after frequenz-floss/frequenz-client-dispatch-python#139 is merged and released.
What's needed?
It is difficult to use the current targets, defined as
TargetComponents = list[int] | list[ComponentCategory], because thematchstatement (andisinstance()can't deal with containers, so we can check that something is alistbut not that is alist[int]. We had issues in the past getting this right and we still do.Proposed solution
Wait until this is implemented in the client:
Dispatch.targetfrequenz-client-dispatch-python#139And then use the same solution here.
Use cases
No response
Alternatives and workarounds
No response
Additional context
This is mostly a reminder that we should update this library and the
DispatchInfoclass after frequenz-floss/frequenz-client-dispatch-python#139 is merged and released.