ソースを参照

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