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:
Tim Abbott 2018-12-17 11:14:47 -08:00
parent 2558f101af
commit a0da4f6d30
4 changed files with 3 additions and 6 deletions

View File

@ -1,8 +1,5 @@
from django.conf import settings
if False:
from zerver.models import UserProfile
from typing import Any, Dict, Optional
from zerver.lib.avatar_hash import gravatar_hash, user_avatar_path_from_ids

View File

@ -17,8 +17,7 @@ from zerver.lib.topic import get_topic_from_message_info
import configparser
if False:
from mypy_extensions import NoReturn
from mypy_extensions import NoReturn
from typing import Any, Optional, List, Dict
from types import ModuleType

View File

@ -19,9 +19,9 @@ import os
import hashlib
if False:
from zerver.models import UserProfile, Realm, Message
# These modules have to be imported for type annotations but
# 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]

View File

@ -51,6 +51,7 @@ from zerver.models import (
from zerver.lib.request import JsonableError
if False:
# Avoid an import cycle; we only need these for type annotations.
from zerver.lib.test_classes import ZulipTestCase, MigrationsTestCase
import collections