|
5 | 5 | # You might need to run it many times since dictionaries come in different orders |
6 | 6 | # every time you run the docstrings. |
7 | 7 | # However the docstring expects it in a specific order in order to pass! |
8 | | -import pytz |
9 | 8 | import difflib |
10 | 9 | import logging |
11 | 10 | import types |
12 | 11 | import datetime |
13 | 12 | from enum import Enum |
14 | 13 | from copy import deepcopy |
15 | 14 | from math import isclose as is_close |
16 | | -from typing import List, Dict, Callable, Union, Any, Pattern, Tuple, Optional, Set, FrozenSet |
| 15 | +from typing import List, Dict, Callable, Union, Any, Pattern, Tuple, Optional, Set, FrozenSet, TYPE_CHECKING |
17 | 16 | from collections.abc import Mapping, Iterable, Sequence |
18 | 17 | from collections import defaultdict |
19 | 18 | from inspect import getmembers |
|
42 | 41 | from deepdiff.base import Base |
43 | 42 | from deepdiff.lfucache import LFUCache, DummyLFU |
44 | 43 |
|
| 44 | +if TYPE_CHECKING: |
| 45 | + from pytz.tzinfo import BaseTzInfo |
| 46 | + |
| 47 | + |
45 | 48 | logger = logging.getLogger(__name__) |
46 | 49 |
|
47 | 50 | MAX_PASSES_REACHED_MSG = ( |
@@ -131,7 +134,7 @@ def __init__(self, |
131 | 134 | custom_operators: Optional[List[Any]] =None, |
132 | 135 | cutoff_distance_for_pairs: float=CUTOFF_DISTANCE_FOR_PAIRS_DEFAULT, |
133 | 136 | cutoff_intersection_for_pairs: float=CUTOFF_INTERSECTION_FOR_PAIRS_DEFAULT, |
134 | | - default_timezone:Union[datetime.timezone, datetime.timezone, pytz.tzinfo.BaseTzInfo]=datetime.timezone.utc, |
| 137 | + default_timezone:Union[datetime.timezone, "BaseTzInfo"]=datetime.timezone.utc, |
135 | 138 | encodings: Optional[List[str]]=None, |
136 | 139 | exclude_obj_callback: Optional[Callable]=None, |
137 | 140 | exclude_obj_callback_strict: Optional[Callable]=None, |
|
0 commit comments