From 8246ee7c57c6d75a38eebee9972f7526e47eb72e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 5 Jul 2022 12:21:44 -0700 Subject: [PATCH] mypy: Add links to specific mypy bugs. Signed-off-by: Anders Kaseorg --- zerver/actions/realm_settings.py | 2 +- zerver/lib/markdown/__init__.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zerver/actions/realm_settings.py b/zerver/actions/realm_settings.py index 281e67f4db..d22e9d6242 100644 --- a/zerver/actions/realm_settings.py +++ b/zerver/actions/realm_settings.py @@ -430,7 +430,7 @@ def do_change_realm_plan_type( realm.message_visibility_limit = None realm.upload_quota_gb = Realm.UPLOAD_QUOTA_STANDARD elif plan_type == Realm.PLAN_TYPE_SELF_HOSTED: - realm.max_invites = None # type: ignore[assignment] # Apparent mypy bug with Optional[int] setter. + realm.max_invites = None # type: ignore[assignment] # https://github.com/python/mypy/issues/3004 realm.message_visibility_limit = None realm.upload_quota_gb = None elif plan_type == Realm.PLAN_TYPE_STANDARD_FREE: diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py index 97f9ae2efc..3c88ff0f55 100644 --- a/zerver/lib/markdown/__init__.py +++ b/zerver/lib/markdown/__init__.py @@ -602,7 +602,7 @@ class InlineImageProcessor(markdown.treeprocessors.Treeprocessor): class BacktickInlineProcessor(markdown.inlinepatterns.BacktickInlineProcessor): """Return a `` element containing the matching text.""" - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: # Let upstream's implementation do its job as it is, we'll @@ -1820,7 +1820,7 @@ class LinkifierPattern(CompiledInlineProcessor): super().__init__(compiled_re2, md) - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[Element, int, int], Tuple[None, None, None]]: db_data: Optional[DbData] = self.md.zulip_db_data @@ -1840,7 +1840,7 @@ class LinkifierPattern(CompiledInlineProcessor): class UserMentionPattern(CompiledInlineProcessor): - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: name = m.group("match") @@ -1896,7 +1896,7 @@ class UserMentionPattern(CompiledInlineProcessor): class UserGroupMentionPattern(CompiledInlineProcessor): - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: name = m.group("match") @@ -1936,7 +1936,7 @@ class StreamPattern(CompiledInlineProcessor): stream_id = db_data.stream_names.get(name) return stream_id - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: name = m.group("stream_name") @@ -1967,7 +1967,7 @@ class StreamTopicPattern(CompiledInlineProcessor): stream_id = db_data.stream_names.get(name) return stream_id - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: stream_name = m.group("stream_name") @@ -2076,7 +2076,7 @@ class LinkInlineProcessor(markdown.inlinepatterns.LinkInlineProcessor): return el - def handleMatch( # type: ignore[override] # supertype incompatible with supersupertype + def handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197 self, m: Match[str], data: str ) -> Union[Tuple[None, None, None], Tuple[Element, int, int]]: ret = super().handleMatch(m, data)