def posts_by_user(user: User, limit: Optional[int] = None) -> List[Post]: return list(islice(user_posts[user], limit))