Skip to content

Commit 2b05c6f

Browse files
committed
Inline a type alias for Pyright
1 parent 8cf60be commit 2b05c6f

File tree

1 file changed

+10
-4
lines changed
  • hypothesis-python/src/hypothesis/strategies/_internal

1 file changed

+10
-4
lines changed

hypothesis-python/src/hypothesis/strategies/_internal/core.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@
118118
except ImportError: # < py3.8
119119
Protocol = object # type: ignore[assignment]
120120

121-
UniqueBy = Union[Callable[[Ex], Hashable], Tuple[Callable[[Ex], Hashable], ...]]
122-
123121

124122
@cacheable
125123
@defines_strategy()
@@ -205,7 +203,11 @@ def lists(
205203
*,
206204
min_size: int = 0,
207205
max_size: Optional[int] = None,
208-
unique_by: Optional[UniqueBy] = None,
206+
unique_by: Union[
207+
None,
208+
Callable[[Ex], Hashable],
209+
Tuple[Callable[[Ex], Hashable], ...],
210+
] = None,
209211
unique: bool = False,
210212
) -> SearchStrategy[List[Ex]]:
211213
"""Returns a list containing values drawn from elements with length in the
@@ -389,7 +391,11 @@ def iterables(
389391
*,
390392
min_size: int = 0,
391393
max_size: Optional[int] = None,
392-
unique_by: Optional[UniqueBy] = None,
394+
unique_by: Union[
395+
None,
396+
Callable[[Ex], Hashable],
397+
Tuple[Callable[[Ex], Hashable], ...],
398+
] = None,
393399
unique: bool = False,
394400
) -> SearchStrategy[Iterable[Ex]]:
395401
"""This has the same behaviour as lists, but returns iterables instead.

0 commit comments

Comments
 (0)