Describe the bug
Pyright doesn't seem to infer base on RHS of expression a @ b, while __rmul__ and dunder function call works fine.
To Reproduce
Create file with the code below
Expected behavior
The code should type check
Screenshots or Code
class A(): pass
class B():
def __rmul__(self, a: A): pass
def __rmatmul__(self, a: A): pass
def __matmul__(self, a: A): pass
a, b = A(), B()
a * b
a @ b # <<< red squiggly here
b.__rmatmul__(a)
b @ a
VS Code extension or command-line
VS Code extension 1.1.43
Additional context
pass
Thanks for the bug report. This will be fixed in the next published version of Pyright.
This is now fixed in version 1.1.44, which I just published.