From d2c995e0acf1d2a9a539022f17c5519e0a1d89cb Mon Sep 17 00:00:00 2001 From: Mina Khoei Date: Tue, 5 Dec 2023 16:08:25 +0100 Subject: [PATCH] importing TypedDict from typing_extensions for python 3.7 --- tonic/cached_dataset.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tonic/cached_dataset.py b/tonic/cached_dataset.py index e6c52cf..5ca2495 100644 --- a/tonic/cached_dataset.py +++ b/tonic/cached_dataset.py @@ -1,10 +1,17 @@ import logging import os +import sys + +if sys.version_info >= (3, 8): + from typing import Callable, Iterable, Optional, Tuple, TypedDict, Union +else: + from typing import Callable, Iterable, Optional, Tuple, Union + from typing_extensions import TypedDict + import random import shutil from dataclasses import dataclass, field from pathlib import Path -from typing import Callable, Iterable, Optional, Tuple, TypedDict, Union from warnings import warn import h5py