random.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. def random() -> float:
  2. '''
  3. Get a random float value between 0.0 (inclusive) and 1.0 (exclusive).
  4. :returns: The random value.
  5. .. versionadded:: 1.6.0
  6. '''
  7. pass
  8. def randrange(start: int, stop: int, step: int = 1) -> int:
  9. '''
  10. Get a random integer between ``start`` (inclusive) and ``stop``
  11. (exclusive) with an optional ``step`` between the values.
  12. :param start: The start value.
  13. :param stop: The end value.
  14. :param step: The optional step value.
  15. :returns: The random value.
  16. .. versionadded:: 1.6.0
  17. .. hint::
  18. This function does only generate integer values.
  19. '''
  20. pass
  21. def randint(a: int, b: int) -> int:
  22. '''
  23. Get a random integer between ``a`` (inclusive) and ``b`` (inclusive).
  24. :param a: The lower value.
  25. :param b: The upper value.
  26. :returns: The random value.
  27. .. versionadded:: 1.6.0
  28. '''
  29. pass
  30. def choice[T](seq: list[T]) -> T:
  31. '''
  32. Get a random element from the provided sequence.
  33. :param seq: The sequence to use.
  34. :returns: A random element.
  35. .. versionadded:: 1.6.0
  36. '''
  37. pass
  38. def getrandbits(k: int) -> int:
  39. '''
  40. Get ``k`` random bits.
  41. :param k: The number of bits.
  42. :returns: The random bits.
  43. .. versionadded:: 1.6.0
  44. '''
  45. pass
  46. def uniform(a: float, b: float) -> float:
  47. '''
  48. Get a random float value between ``a`` (inclusive) and ``b`` (inclusive).
  49. :param a: The lower value.
  50. :param b: The upper value.
  51. :returns: The random value.
  52. .. versionadded:: 1.6.0
  53. '''
  54. pass
  55. def seed(a: int) -> None:
  56. '''
  57. Initialize the random number generator.
  58. :param a: The initialization value to use.
  59. .. versionadded:: 1.6.0
  60. .. hint::
  61. Random generator seeding is done automatically, so there is no need to call this function.
  62. '''
  63. pass