From 145a85307abb36e3c18ef38d9aac84b9e4ce9982 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 16 Apr 2022 17:01:36 -0700 Subject: [PATCH] `random`: update for py311 (#7651) --- stdlib/random.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 612a54cb9..255436dc3 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -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):