From 65ea540bc419981f47ee23b5343e791c6bbe628c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 22 Mar 2024 11:45:40 +0100 Subject: [PATCH] fix: Python 3.8 support & typing. --- pymisp/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index cda64aa..7f46193 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TypeVar, Any, Mapping, Iterable, MutableMapping, Union +from typing import TypeVar, Any, Mapping, Iterable, MutableMapping, Union, List, Dict from datetime import date, datetime import csv from pathlib import Path @@ -57,7 +57,8 @@ except ImportError: SearchType = TypeVar('SearchType', str, int) # str: string to search / list: values to search (OR) / dict: {'OR': [list], 'NOT': [list], 'AND': [list]} -SearchParameterTypes = TypeVar('SearchParameterTypes', str, list[Union[str, int]], dict[str, Union[str, int]]) +# NOTE: we cannot use new typing here until we drop Python 3.8 and 3.9 support +SearchParameterTypes = TypeVar('SearchParameterTypes', str, List[Union[str, int]], Dict[str, Union[str, int]]) ToIDSType = TypeVar('ToIDSType', str, int, bool)