The following snippet is valid runtime code:
from collections import deque
print(3 * deque([1, 2, 3]))
output:
> uv run t.py
deque([1, 2, 3, 1, 2, 3, 1, 2, 3])
But typeshed doesn't have the __rmul__ dunder specified, so type checkers are complaining.
This is also tested in the python test suite here.
Note
Tested with basedpyright v1.39.9 and python 3.13.7
The following snippet is valid runtime code:
output:
> uv run t.py deque([1, 2, 3, 1, 2, 3, 1, 2, 3])But typeshed doesn't have the
__rmul__dunder specified, so type checkers are complaining.This is also tested in the python test suite here.
Note
Tested with basedpyright v1.39.9 and python 3.13.7