addressee: Clean up type ignores.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-08-09 15:30:33 -07:00
parent e417d3a040
commit 9b392917c5
2 changed files with 5 additions and 4 deletions

View File

@@ -1842,7 +1842,7 @@ def get_recipient_from_user_ids(recipient_profile_ids: Set[int],
else: else:
return get_personal_recipient(list(recipient_profile_ids)[0]) return get_personal_recipient(list(recipient_profile_ids)[0])
def validate_recipient_user_profiles(user_profiles: List[UserProfile], def validate_recipient_user_profiles(user_profiles: Sequence[UserProfile],
sender: UserProfile, sender: UserProfile,
allow_deactivated: bool=False) -> Set[int]: allow_deactivated: bool=False) -> Set[int]:
recipient_profile_ids = set() recipient_profile_ids = set()
@@ -1904,7 +1904,7 @@ def recipient_for_user_ids(user_ids: Iterable[int], sender: UserProfile) -> Reci
sender=sender sender=sender
) )
def recipient_for_user_profiles(user_profiles: List[UserProfile], forwarded_mirror_message: bool, def recipient_for_user_profiles(user_profiles: Sequence[UserProfile], forwarded_mirror_message: bool,
forwarder_user_profile: Optional[UserProfile], forwarder_user_profile: Optional[UserProfile],
sender: UserProfile, allow_deactivated: bool=False) -> Recipient: sender: UserProfile, allow_deactivated: bool=False) -> Recipient:

View File

@@ -91,9 +91,10 @@ class Addressee:
def is_private(self) -> bool: def is_private(self) -> bool:
return self._msg_type == 'private' return self._msg_type == 'private'
def user_profiles(self) -> List[UserProfile]: def user_profiles(self) -> Sequence[UserProfile]:
assert(self.is_private()) assert(self.is_private())
return self._user_profiles # type: ignore # assertion protects us assert self._user_profiles is not None
return self._user_profiles
def stream(self) -> Optional[Stream]: def stream(self) -> Optional[Stream]:
assert(self.is_stream()) assert(self.is_stream())