Add stub for random.Random.choices (#2156)

This commit is contained in:
Jakub Nabaglo
2018-05-22 12:38:00 +10:00
committed by Jelle Zijlstra
parent 128a49a32d
commit d84069e78d

View File

@@ -23,6 +23,8 @@ class Random(_random.Random):
def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ...
def randint(self, a: int, b: int) -> int: ...
def choice(self, seq: Sequence[_T]) -> _T: ...
if sys.version_info >= (3, 6):
def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ...
def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
def random(self) -> float: ...