A Python reader brings habits from names, dictionaries, classes, protocols, exceptions, None, imports, and duck typing. That helps with code around domain words before machinery, but the Musi page asks a narrower question: what contract should this branching and block results example make visible?
def delivery_fee(distance_km: int) -> int:
if distance_km == 0:
return 0
return 45let deliveryFee (distanceKm : Int) : Int := match distanceKm (
| 0 => 0
| _ => 45
);
deliveryFee(3);Reading Blocks, Control Flow, and Repetition from Python
On the Musi side, Musi blocks and matches are expressions when they produce a value; the branch answer matters more than the statement container. Read the shared example through Python eyes: keep the useful instinct, then let Musi name shape, behavior, absence, and outside work in separate places.
False friend
Do not carry over temporary variables whose only job was to smuggle a branch result out of a statement block. For a Python reader, the trap is trusting runtime convention where Musi expects a visible type or effect; Musi class is closer to an explicit protocol/typeclass than a Python class with attributes and methods.
When this pays off
Use this shape when a route fee, access decision, or small rule table chooses one value from several cases. The Python instinct still helps here: Keep the Python habit of naming the real-world thing first.