def get_remaining_shared_breaks_this_week(group_members: Set[User]) -> List[Break]:
"""
Finds this weeks remaining common breaks between a group of users
"""
# So, the Mypy type checker treats `List` as invariant, meaning we
# can't give a `List[B]` to a function that expects a `List[A]` if
# B is a subclass of A.
# So we have to cast it in to the function...
# FIXME: Get rid of these casts when Van Rossum figures out how to write a
# proper type system
breaks = cast(List[Event_], get_shared_breaks(group_members))
now = datetime.now(BRISBANE_TIME_ZONE)
### ... and out.
return cast(List[Break], get_this_weeks_events(now, breaks))
# FIXME: Make 'request_status' an enum: https://docs.python.org/3/library/enum.html
评论列表
文章目录