From: Federico Caselli Date: Wed, 26 Jan 2022 18:44:14 +0000 (+0100) Subject: fix typing syntax in python < 3.9 X-Git-Tag: rel_2_0_0b1~508 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2428094b0ebe92caafbe0680f8a0ce3cd18d9b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix typing syntax in python < 3.9 Change-Id: If4bca7299a333ff585de6e486ba84276cc75ab6d --- diff --git a/lib/sqlalchemy/util/_py_collections.py b/lib/sqlalchemy/util/_py_collections.py index 7914507cdd..fd149d5bb4 100644 --- a/lib/sqlalchemy/util/_py_collections.py +++ b/lib/sqlalchemy/util/_py_collections.py @@ -196,7 +196,7 @@ class OrderedSet(Set[_T]): other_set = super().difference(*other) return self.__class__(a for a in self._list if a in other_set) - def __sub__(self, other: AbstractSet[_T | None]) -> "OrderedSet[_T]": + def __sub__(self, other: AbstractSet[Optional[_T]]) -> "OrderedSet[_T]": return self.difference(other) def intersection_update(self, *other: Iterable[Any]) -> None: @@ -220,7 +220,7 @@ class OrderedSet(Set[_T]): super().difference_update(*other) self._list = [a for a in self._list if a in self] - def __isub__(self, other: AbstractSet[_T | None]) -> "OrderedSet[_T]": + def __isub__(self, other: AbstractSet[Optional[_T]]) -> "OrderedSet[_T]": self.difference_update(other) return self