We could use special values to represent `INFINITE` and `INSTANTANEOUS` for the `Dispatch.duration` field, so the code gets more readable (without the need for comments) and more type-safe. We could set the type of `duration: timedelta | Duration` where duration is a enum for example, then we can also use `match` like this: ```py match dispatch.duration: case Duration.INFINITE: ... case Duration.INSTANTANEOUS: ... case timedelta(): ... (here we know it is > 0) case unexpected: assert_never(unexpected) ``` Taking it even a bit further, we could have a `PositiveTimedelta` object that even guarantee the time is positive. _Originally posted by @llucax in https://github.com/frequenz-floss/frequenz-dispatch-python/pull/54#discussion_r1772738674_