Skip to content

Commit

Permalink
Inline a type alias for Pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Apr 18, 2022
1 parent 8cf60be commit 2b05c6f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions hypothesis-python/src/hypothesis/strategies/_internal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
except ImportError: # < py3.8
Protocol = object # type: ignore[assignment]

UniqueBy = Union[Callable[[Ex], Hashable], Tuple[Callable[[Ex], Hashable], ...]]


@cacheable
@defines_strategy()
Expand Down Expand Up @@ -205,7 +203,11 @@ def lists(
*,
min_size: int = 0,
max_size: Optional[int] = None,
unique_by: Optional[UniqueBy] = None,
unique_by: Union[
None,
Callable[[Ex], Hashable],
Tuple[Callable[[Ex], Hashable], ...],
] = None,
unique: bool = False,
) -> SearchStrategy[List[Ex]]:
"""Returns a list containing values drawn from elements with length in the
Expand Down Expand Up @@ -389,7 +391,11 @@ def iterables(
*,
min_size: int = 0,
max_size: Optional[int] = None,
unique_by: Optional[UniqueBy] = None,
unique_by: Union[
None,
Callable[[Ex], Hashable],
Tuple[Callable[[Ex], Hashable], ...],
] = None,
unique: bool = False,
) -> SearchStrategy[Iterable[Ex]]:
"""This has the same behaviour as lists, but returns iterables instead.
Expand Down

0 comments on commit 2b05c6f

Please sign in to comment.