From 017f4efa0fdc83da9956540d6ba5b377cd184b62 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 6 Jan 2016 16:29:04 -0800 Subject: [PATCH] Simplify SystemRandom now it subclasses Random, for 2.7 and 3. --- stdlib/2.7/random.pyi | 7 ++----- stdlib/3/random.pyi | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/stdlib/2.7/random.pyi b/stdlib/2.7/random.pyi index c817e5d28..e8800c8e5 100644 --- a/stdlib/2.7/random.pyi +++ b/stdlib/2.7/random.pyi @@ -44,11 +44,8 @@ class Random(_random.Random): def weibullvariate(self, alpha: float, beta: float) -> float: ... # SystemRandom is not implemented for all OS's; good on Windows & Linux -class SystemRandom: - def __init__(self, randseed: object = ...) -> None: ... - def random(self) -> float: ... - def getrandbits(self, k: int) -> int: ... - def seed(self, x: object = ...) -> None: ... +class SystemRandom(Random): + ... # ----- random function stubs ----- def seed(x: object = ...) -> None: ... diff --git a/stdlib/3/random.pyi b/stdlib/3/random.pyi index e2cd89547..f40d97320 100644 --- a/stdlib/3/random.pyi +++ b/stdlib/3/random.pyi @@ -40,10 +40,7 @@ class Random(_random.Random): # SystemRandom is not implemented for all OS's; good on Windows & Linux class SystemRandom(Random): - def __init__(self, randseed: object = ...) -> None: ... - def random(self) -> float: ... - def getrandbits(self, k: int) -> int: ... - def seed(self, arg: object) -> None: ... + ... # ----- random function stubs ----- def seed(a: Any = ..., version: int = ...) -> None: ...