LearnMusi for DevelopersMusi for Python DevelopersNames, Mutation, and Fresh Values

Names, Mutation, and Fresh Values

Read Names, Mutation, and Fresh Values as a Python habit shift, with links to the Musi Book definition.

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 local values and calls example make visible?

python
queue_depth = 0
queue_depth += 1
visible_depth = queue_depth

Reading Names, Mutation, and Fresh Values from Python

On the Musi side, Musi lets a calculation be a let, a function, or a final expression without wrapping it in an object or framework first. 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 preserve call ceremony just because the source language needs it for methods, receivers, overloads, or closures. 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 receipt total, label, distance, or score is pure data moving through named calls. The Python instinct still helps here: Keep the Python habit of naming the real-world thing first.

Keep close