You're missing an option which is type narrowing. Mypy as of 1.7 will recognize the tuple is proper if the length matches.
```python
def shift_week(dayofweek: int, week: T_week) -> T_week:
week_shifted: list[T_day] = []
week_shifted.extend(week[dayofweek:])
week_shifted.extend(week[:dayofweek])
rt = tuple(week_shifted)
assert len(rt) == 7
return rt
```
Starting in version 1.7, mypy supports narrowing tuples using `len` checks. (This was part of [PR #16237].) Thus, you can just throw a quick assertion into your function:
```python
T_day = int | None
T_week = tuple[T_day, T_day, T_day, T_day, T_day, T_day, T_day]
def shift_week(dayofweek: int, week: T_week) -> T_week:
week_shifted: list[T_day] = []
week_shifted.extend(week[dayofweek:])
week_shifted.extend(week[:dayofweek])
rt = tuple(week_shifted)
assert len(rt) == 7
return rt
```
[PR #16237]: https://github.com/python/mypy/pull/16237