Kaynağa Gözat

made TypedDict import compatible with python < 3.8

tanja 3 yıl önce
ebeveyn
işleme
db6b97772a
2 değiştirilmiş dosya ile 8 ekleme ve 2 silme
  1. 1 1
      Pipfile.lock
  2. 7 1
      cdplib/pipeline_selector/PipelineSelector.py

+ 1 - 1
Pipfile.lock

@@ -26,7 +26,7 @@
         "cdplib": {
             "editable": true,
             "git": "https://readonly:readonly@intra.acdp.at/gogs/tanja/cdplib.git",
-            "ref": "ce7201d0103a1170d8efe42f7d59c75d1c1f433e"
+            "ref": "362220280f6768abda363240b5fce51eb4d9016e"
         },
         "certifi": {
             "hashes": [

+ 7 - 1
cdplib/pipeline_selector/PipelineSelector.py

@@ -26,8 +26,14 @@ import numpy as np
 import pandas as pd
 from copy import deepcopy
 from abc import ABC, abstractmethod, abstractproperty
-from typing import Callable, TypedDict,\
+
+if sys.version_info >= (3, 8):
+    from typing import Callable, TypedDict,\
+    Literal, Dict, Iterable, List, Tuple, Union
+else:
+    from typing_extensions import Callable, TypedDict,\
     Literal, Dict, Iterable, List, Tuple, Union
+
 import functools
 from sklearn.pipeline import Pipeline
 from sklearn.model_selection import cross_validate as sklearn_cross_validation