From edaeed69e9321592a2ab70cef310606b473ac8a4 Mon Sep 17 00:00:00 2001 From: Tero Vuotila Date: Tue, 12 Nov 2024 23:55:16 +0200 Subject: [PATCH] Remove Collection[str] type from ElementTypes (#2134) --- faker/providers/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faker/providers/__init__.py b/faker/providers/__init__.py index fec2f1b00e..2dca6eb9fd 100644 --- a/faker/providers/__init__.py +++ b/faker/providers/__init__.py @@ -17,7 +17,7 @@ _re_cir = re.compile(r"\^") T = TypeVar("T") -ElementsType = Union[Collection[str], Collection[T], OrderedDictType[T, float]] +ElementsType = Union[Collection[T], OrderedDictType[T, float]] class BaseProvider: @@ -533,7 +533,7 @@ def random_choices( """ return self.random_elements(elements, length, unique=False) - def random_element(self, elements: ElementsType[T] = ("a", "b", "c")) -> T: + def random_element(self, elements: ElementsType[T] = ("a", "b", "c")) -> T: # type: ignore[assignment] """Generate a randomly sampled object from ``elements``. For information on the ``elements`` argument, please refer to