random.pyi 827 B

123456789101112131415161718192021
  1. from typing import Callable, Tuple, Union, Sequence, Any, Optional
  2. __all__ = ['StrongRandom', 'getrandbits', 'randrange', 'randint', 'choice', 'shuffle', 'sample']
  3. class StrongRandom(object):
  4. def __init__(self, rng: Optional[Any]=None, randfunc: Optional[Callable]=None) -> None: ... # TODO What is rng?
  5. def getrandbits(self, k: int) -> int: ...
  6. def randrange(self, start: int, stop: int = ..., step: int = ...) -> int: ...
  7. def randint(self, a: int, b: int) -> int: ...
  8. def choice(self, seq: Sequence) -> object: ...
  9. def shuffle(self, x: Sequence) -> None: ...
  10. def sample(self, population: Sequence, k: int) -> list: ...
  11. _r = StrongRandom()
  12. getrandbits = _r.getrandbits
  13. randrange = _r.randrange
  14. randint = _r.randint
  15. choice = _r.choice
  16. shuffle = _r.shuffle
  17. sample = _r.sample