]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Change typing 11378/head
authorSemyon Pupkov <mail@semyonpupkov.com>
Sat, 11 May 2024 11:43:52 +0000 (16:43 +0500)
committerSemyon Pupkov <mail@semyonpupkov.com>
Sat, 11 May 2024 11:51:49 +0000 (16:51 +0500)
lib/sqlalchemy/util/_collections.py

index f5edf275f5ef5fe91501480949d1802bb291b020..34b435e05f7da8f757dd47cb6128d2bb067fc47f 100644 (file)
@@ -16,6 +16,7 @@ import typing
 from typing import Any
 from typing import Callable
 from typing import cast
+from typing import Container
 from typing import Dict
 from typing import FrozenSet
 from typing import Generic
@@ -401,14 +402,13 @@ def to_list(x: Any, default: Optional[List[Any]] = None) -> List[Any]:
         return list(x)
 
 
-def has_intersection(set_: Union[Set[Any], FrozenSet[Any]], iterable: Iterable[Any]) -> bool:
+def has_intersection(set_: Container[Any], iterable: Iterable[Any]) -> bool:
     r"""return True if any items of set\_ are present in iterable.
 
     Goes through special effort to ensure __hash__ is not called
     on items in iterable that don't support it.
 
     """
-    # TODO: optimize, write in C, etc.
     return any(i in set_ for i in iterable if i.__hash__)