Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
addressee: Remove redundant casts.
Anders Kaseorg78f44828672a
diff --git a/mypy.ini b/mypy.iniindex 1219d77e07a..ea6963a91d0 100644--- a/mypy.ini+++ b/mypy.ini@@ -13,6 +13,7 @@ disallow_untyped_defs = Truedisallow_any_generics = Truewarn_no_return = Trueno_implicit_optional = True+warn_redundant_casts = True# Display the codes needed for # type: ignore[code] annotations.show_error_codes = Truediff --git a/zerver/lib/addressee.py b/zerver/lib/addressee.pyindex b0b57c1a4d7..cdb820eafa9 100644--- a/zerver/lib/addressee.py+++ b/zerver/lib/addressee.py@@ -129,11 +129,9 @@ class Addressee:raise JsonableError(_("Missing topic"))if isinstance(stream_name_or_id, int):- stream_id = cast(int, stream_name_or_id)- return Addressee.for_stream_id(stream_id, topic_name)+ return Addressee.for_stream_id(stream_name_or_id, topic_name)- stream_name = cast(str, stream_name_or_id)- return Addressee.for_stream_name(stream_name, topic_name)+ return Addressee.for_stream_name(stream_name_or_id, topic_name)elif message_type_name == 'private':if not message_to:raise JsonableError(_("Message must have recipients"))