|
118 | 118 | except ImportError: # < py3.8
|
119 | 119 | Protocol = object # type: ignore[assignment]
|
120 | 120 |
|
121 |
| -UniqueBy = Union[Callable[[Ex], Hashable], Tuple[Callable[[Ex], Hashable], ...]] |
122 |
| - |
123 | 121 |
|
124 | 122 | @cacheable
|
125 | 123 | @defines_strategy()
|
@@ -205,7 +203,11 @@ def lists(
|
205 | 203 | *,
|
206 | 204 | min_size: int = 0,
|
207 | 205 | 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, |
209 | 211 | unique: bool = False,
|
210 | 212 | ) -> SearchStrategy[List[Ex]]:
|
211 | 213 | """Returns a list containing values drawn from elements with length in the
|
@@ -389,7 +391,11 @@ def iterables(
|
389 | 391 | *,
|
390 | 392 | min_size: int = 0,
|
391 | 393 | 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, |
393 | 399 | unique: bool = False,
|
394 | 400 | ) -> SearchStrategy[Iterable[Ex]]:
|
395 | 401 | """This has the same behaviour as lists, but returns iterables instead.
|
|
0 commit comments