소스 검색

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