From c3f2611b166b8ab3bde35eb8ae7dde3936e99ceb Mon Sep 17 00:00:00 2001 From: Jason Scheffel Date: Mon, 20 Jul 2026 20:45:51 -0400 Subject: [PATCH] fix(collections): add deque reverse multiplication Declare `deque.__rmul__` so type checkers accept multiplication with an integer on the left. Refs: #16034 Signed-off-by: Jason Scheffel --- stdlib/collections/__init__.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 39b8a3c9ab6a..087746409ecb 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -277,6 +277,7 @@ class deque(MutableSequence[_T]): def __iadd__(self, value: Iterable[_T], /) -> Self: ... def __add__(self, value: Self, /) -> Self: ... def __mul__(self, value: int, /) -> Self: ... + def __rmul__(self, value: int, /) -> Self: ... def __imul__(self, value: int, /) -> Self: ... def __lt__(self, value: deque[_T], /) -> bool: ... def __le__(self, value: deque[_T], /) -> bool: ...