mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
python: Clean up various if False blocks.
Most of these are now-unnecessary typing imports; some are just improved comments for those with other mypy motivations.
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
if False:
|
|
||||||
from zerver.models import UserProfile
|
|
||||||
|
|
||||||
from typing import Any, Dict, Optional
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
from zerver.lib.avatar_hash import gravatar_hash, user_avatar_path_from_ids
|
from zerver.lib.avatar_hash import gravatar_hash, user_avatar_path_from_ids
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ from zerver.lib.topic import get_topic_from_message_info
|
|||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
if False:
|
|
||||||
from mypy_extensions import NoReturn
|
from mypy_extensions import NoReturn
|
||||||
from typing import Any, Optional, List, Dict
|
from typing import Any, Optional, List, Dict
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import os
|
|||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
from zerver.models import UserProfile, Realm, Message
|
|
||||||
# These modules have to be imported for type annotations but
|
# These modules have to be imported for type annotations but
|
||||||
# they cannot be imported at runtime due to cyclic dependency.
|
# they cannot be imported at runtime due to cyclic dependency.
|
||||||
|
from zerver.models import UserProfile, Realm, Message
|
||||||
|
|
||||||
ReturnT = TypeVar('ReturnT') # Useful for matching return types via Callable[..., ReturnT]
|
ReturnT = TypeVar('ReturnT') # Useful for matching return types via Callable[..., ReturnT]
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ from zerver.models import (
|
|||||||
from zerver.lib.request import JsonableError
|
from zerver.lib.request import JsonableError
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
|
# Avoid an import cycle; we only need these for type annotations.
|
||||||
from zerver.lib.test_classes import ZulipTestCase, MigrationsTestCase
|
from zerver.lib.test_classes import ZulipTestCase, MigrationsTestCase
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|||||||
Reference in New Issue
Block a user