-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
Describe the bug
pyright
marks methods wrapped with functools.cache
/functools.lru_cache
decorator calls as error: Argument missing for parameter "self"
. Functions are not affected, only methods.
This bug was introduced in 1.1.187
. 1.1.186
is not affected.
To Reproduce
Run pyright
on this sample:
from functools import cache
class A:
@cache
def has_cache(self) -> None:
print(self)
def no_cache(self) -> None:
print(self)
a = A()
a.has_cache() # error: Argument missing for parameter "self"
a.has_cache(a) # no typing errors, but obviously a RuntimeError
a.no_cache() # all good
Expected behavior
No error
VS Code extension or command-line
Command line with pyright 1.1.187
.
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working