mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add stub for random.Random.choices (#2156)
This commit is contained in:
committed by
Jelle Zijlstra
parent
128a49a32d
commit
d84069e78d
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user