models.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:suq 作者: MaxwellBo 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号