Is it possible to pull out types as a variable of sorts, and use them as typing for functions?
I’ve tried what I thought would make sense, but it doesn’t work:
DayOfWeek = Literal["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
def get_closest_day_by_day_of_week(
date: datetime,
day_of_week: DayOfWeek # <--- this does not work
):
pass
1