typing: Use TYPE_CHECKING when dealing with cyclic dependencies.

This commit is contained in:
Wyatt Hoodes
2019-07-30 08:58:48 -10:00
committed by Tim Abbott
parent 97c10b35c2
commit 4beec5c6b9
4 changed files with 9 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
from contextlib import contextmanager
from typing import (
Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping,
Optional, Tuple, Union, IO, TypeVar
Optional, Tuple, Union, IO, TypeVar, TYPE_CHECKING
)
from django.core import signing
@@ -38,7 +38,7 @@ from zerver.models import (
UserProfile,
)
if False:
if TYPE_CHECKING:
# Avoid an import cycle; we only need these for type annotations.
from zerver.lib.test_classes import ZulipTestCase, MigrationsTestCase