File: _random.pyi

package info (click to toggle)
typeshed 0.0~git20260204.516eed0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,220 kB
  • sloc: python: 9,096; makefile: 21; sh: 18
file content (18 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys
from typing_extensions import Self, TypeAlias, disjoint_base

# Actually Tuple[(int,) * 625]
_State: TypeAlias = tuple[int, ...]

@disjoint_base
class Random:
    if sys.version_info >= (3, 10):
        def __init__(self, seed: object = ..., /) -> None: ...
    else:
        def __new__(self, seed: object = ..., /) -> Self: ...

    def seed(self, n: object = None, /) -> None: ...
    def getstate(self) -> _State: ...
    def setstate(self, state: _State, /) -> None: ...
    def random(self) -> float: ...
    def getrandbits(self, k: int, /) -> int: ...