From 5a1fc4d470da6ef6f238874b6348944c45aab125 Mon Sep 17 00:00:00 2001 From: "Davide Gessa (dakk)" Date: Thu, 11 Apr 2024 12:58:58 +0200 Subject: [PATCH] fix qtype for different python versions --- qlasskit/types/qtype.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qlasskit/types/qtype.py b/qlasskit/types/qtype.py index 1387bb75..88904faf 100644 --- a/qlasskit/types/qtype.py +++ b/qlasskit/types/qtype.py @@ -22,7 +22,12 @@ else: from typing import TypeAlias -TType: TypeAlias = Union[type[bool], type["Qtype"]] +if sys.version_info >= (3, 9): + from builtins import type as Type +else: + from typing import Type + +TType: TypeAlias = Union[Type[bool], Type["Qtype"]] TExp: TypeAlias = Tuple[TType, Boolean] T = TypeVar("T")