clockblocks.moment.to_absolute_moment
- clockblocks.moment.to_absolute_moment(when: float | ResolvableMoment | None, clock: Clock, *, units_if_number: str | DurationUnits = DurationUnits.BEATS, relative_if_number: bool = True, allow_number: bool = True) Moment[source]
Coerce a when argument into an absolute Moment on clock. None is treated as “now” (relative 0); anything that isn’t None or a number is assumed to be a ResolvableMoment and resolved.
A bare number is handled per allow_number: when True (wait()/wait_until(), whose names fix the meaning) it is wrapped using the caller’s convention (units_if_number / relative_if_number); when False (fork()/schedule_action(), where “when” alone wouldn’t say whether a number is relative or absolute) a number raises TypeError, steering the caller to an explicit Moment.