Justification: Python pattern matching is based on order not specificity, so the following code never makes it into the second branch.
match span:
case CBlock():
handle cblocks generically
case ModelOutputThunk():
handle mots in particular
case Component():
handle more complex stuff
This is a footgun. The easiest solution is to simply remove mot from the cblock type hierarchy. There are no disadvanatges: anywhere we expect a cblock or a mot we should be explicit about that with a union type anyways, because mot.value is semantically different from cb.value
Justification: Python pattern matching is based on order not specificity, so the following code never makes it into the second branch.
This is a footgun. The easiest solution is to simply remove mot from the cblock type hierarchy. There are no disadvanatges: anywhere we expect a cblock or a mot we should be explicit about that with a union type anyways, because
mot.valueis semantically different fromcb.value