浏览代码

trying to fix typing issues

ogert 3 年之前
父节点
当前提交
6e70eecdae
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      cdplib/hyperopt/HyperoptPipelineSelector.py
  2. 3 0
      cdplib/pipeline_selector/PipelineSelector.py

+ 3 - 0
cdplib/hyperopt/HyperoptPipelineSelector.py

@@ -38,6 +38,9 @@ if (sys.version_info.major == 3) & (sys.version_info.minor >= 8):
     Literal, Dict, List, Union
 else:
     # from typing_extensions import *
+    from __future__ import annotations
+    Dict = dict
+    List = list
     from typing_extensions import Callable, \
     Literal, Dict, List, Union
 

+ 3 - 0
cdplib/pipeline_selector/PipelineSelector.py

@@ -34,6 +34,9 @@ if (sys.version_info.major == 3) & (sys.version_info.minor >= 8):
 else:
     # from typing_extensions import *
     print("I have python version {}.{} and will import typing_extensions".format(sys.version_info.major, sys.version_info.minor))
+    from __future__ import annotations
+    Dict = dict
+    List = list
     from typing_extensions import Callable, TypedDict,\
     Literal, Dict, Iterable, List, Tuple, Union