mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
python: Annotate type aliases with TypeAlias.
This is not strictly necessary but it’s clearer and improves mypy’s error messages. https://docs.python.org/3/library/typing.html#typing.TypeAlias https://mypy.readthedocs.io/en/stable/kinds_of_types.html#type-aliases Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
f55711dae3
commit
c2c96eb0cf
@@ -7,6 +7,7 @@ from typing import Any, Collection, Dict, List, Set, Tuple
|
||||
from django.conf import settings
|
||||
from django.db import transaction
|
||||
from django.utils.timezone import now as timezone_now
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from confirmation.models import one_click_unsubscribe_link
|
||||
from zerver.context_processors import common_context
|
||||
@@ -34,7 +35,7 @@ log_to_file(logger, settings.DIGEST_LOG_PATH)
|
||||
DIGEST_CUTOFF = 5
|
||||
MAX_HOT_TOPICS_TO_BE_INCLUDED_IN_DIGEST = 4
|
||||
|
||||
TopicKey = Tuple[int, str]
|
||||
TopicKey: TypeAlias = Tuple[int, str]
|
||||
|
||||
|
||||
class DigestTopic:
|
||||
|
||||
Reference in New Issue
Block a user