Defensive: a ``.value``-bearing object → its ``.value``, else the value unchanged. ``TaskType``/``TaskStatus`` are ``Literal[str]`` today (already plain strings, so this just passes them through) — this only future-proofs against an enum/wrapper.
(x: Any)
| 24 | |
| 25 | |
| 26 | def _coerce(x: Any) -> Any: |
| 27 | """Defensive: a ``.value``-bearing object → its ``.value``, else the value unchanged. |
| 28 | ``TaskType``/``TaskStatus`` are ``Literal[str]`` today (already plain strings, so this |
| 29 | just passes them through) — this only future-proofs against an enum/wrapper.""" |
| 30 | return getattr(x, "value", x) |
| 31 | |
| 32 | |
| 33 | def _format_task(t: Any) -> str: |