Welcome · Page 2 of 3

Plain Python, Zero Cost

Every declaration in temporal-typing is passive.

Importing a module, decorating a class with @spec, constructing a Model, instantiating a class, and calling its methods never execute a single predicate. At runtime, Lamp().toggle() runs as ordinary Python with zero overhead.

The package is fully typed (PEP 561) and uses standard typing.Annotated constructs, so mypy --strict and Pyright check specified classes just like any other Python code. Expression primitives such as prime and always are never called at runtime — they exist for a checker to read from source.

Just as typing declares types and leaves checking to mypy, temporal-typing declares behaviour and provides a shared front-end (python -m temporal_typing) that reads your source without executing it.

Try it: Click Check. Notice how on: State[bool] = False provides the initial state, and Action() with no predicate tells the checker to treat the Python method body itself as the transition.
Click Check (or press Shift+Enter) to run the front-end and check this specification. Switch to TLA⁺ to view its TLA⁺ meaning.
---- MODULE Lamp ----
VARIABLE on

Init == on = FALSE
Toggle == on' = ~on
Next == Toggle
Spec == Init /\ [][Next]_on

Valid == on \in {TRUE, FALSE}
====