mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
random: add VERSION, SystemRandom.getrandbits is not pos only (#6419)
Co-authored-by: Akuli <akuviljanen17@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2,11 +2,12 @@ import _random
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, MutableSequence, Sequence
|
||||
from fractions import Fraction
|
||||
from typing import Any, NoReturn, Tuple, TypeVar
|
||||
from typing import Any, ClassVar, NoReturn, Tuple, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class Random(_random.Random):
|
||||
VERSION: ClassVar[int]
|
||||
def __init__(self, x: Any = ...) -> None: ...
|
||||
def seed(self, a: Any = ..., version: int = ...) -> None: ...
|
||||
def getstate(self) -> Tuple[Any, ...]: ...
|
||||
@@ -45,6 +46,7 @@ class Random(_random.Random):
|
||||
|
||||
# SystemRandom is not implemented for all OS's; good on Windows & Linux
|
||||
class SystemRandom(Random):
|
||||
def getrandbits(self, k: int) -> int: ... # k can be passed by keyword
|
||||
def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
|
||||
def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user