1
1
import _random
2
2
import sys
3
- from collections .abc import Callable , Iterable , MutableSequence , Sequence
3
+ from collections .abc import Callable , Iterable , MutableSequence , Sequence , Set as AbstractSet
4
4
from fractions import Fraction
5
5
from typing import Any , NoReturn , Tuple , TypeVar
6
6
@@ -27,9 +27,9 @@ class Random(_random.Random):
27
27
) -> list [_T ]: ...
28
28
def shuffle (self , x : MutableSequence [Any ], random : Callable [[], float ] | None = ...) -> None : ...
29
29
if sys .version_info >= (3 , 9 ):
30
- def sample (self , population : Sequence [_T ] | set [_T ], k : int , * , counts : Iterable [_T ] | None = ...) -> list [_T ]: ...
30
+ def sample (self , population : Sequence [_T ] | AbstractSet [_T ], k : int , * , counts : Iterable [_T ] | None = ...) -> list [_T ]: ...
31
31
else :
32
- def sample (self , population : Sequence [_T ] | set [_T ], k : int ) -> list [_T ]: ...
32
+ def sample (self , population : Sequence [_T ] | AbstractSet [_T ], k : int ) -> list [_T ]: ...
33
33
def random (self ) -> float : ...
34
34
def uniform (self , a : float , b : float ) -> float : ...
35
35
def triangular (self , low : float = ..., high : float = ..., mode : float | None = ...) -> float : ...
@@ -66,10 +66,10 @@ def choices(
66
66
def shuffle (x : MutableSequence [Any ], random : Callable [[], float ] | None = ...) -> None : ...
67
67
68
68
if sys .version_info >= (3 , 9 ):
69
- def sample (population : Sequence [_T ] | set [_T ], k : int , * , counts : Iterable [_T ] | None = ...) -> list [_T ]: ...
69
+ def sample (population : Sequence [_T ] | AbstractSet [_T ], k : int , * , counts : Iterable [_T ] | None = ...) -> list [_T ]: ...
70
70
71
71
else :
72
- def sample (population : Sequence [_T ] | set [_T ], k : int ) -> list [_T ]: ...
72
+ def sample (population : Sequence [_T ] | AbstractSet [_T ], k : int ) -> list [_T ]: ...
73
73
74
74
def random () -> float : ...
75
75
def uniform (a : float , b : float ) -> float : ...
0 commit comments