random: update for py311 (#7651)

This commit is contained in:
Shantanu
2022-04-16 17:01:36 -07:00
committed by GitHub
parent 520f807b5f
commit 145a85307a

View File

@@ -89,7 +89,10 @@ class Random(_random.Random):
cum_weights: Sequence[float | Fraction] | None = ...,
k: int = ...,
) -> list[_T]: ...
def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
if sys.version_info >= (3, 11):
def shuffle(self, x: MutableSequence[Any]) -> None: ...
else:
def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ...
if sys.version_info >= (3, 11):
def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = ...) -> list[_T]: ...
elif sys.version_info >= (3, 9):