-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function that returns decorator as class member raises "self-argument missing" #15549
Comments
This is not entirely valid code. m = MyClass()
m.log() # doesn't make any sense |
I'm going to say this is out of scope. This use case is very rare, and any reasonable solution is going to make it a lot harder for mypy to correctly report cases where the user forgot to add |
If you mark the method |
That does run for more recent python, but not 3.8.10 (for example). |
Bug Report
Similar to #7778, where having a function that returns a decorator inside a class without a self parameter
is not possible.
To Reproduce
I have this setup to be able to do this inside a class:
Expected Behavior
mypy should not find any errors with this.
Actual Behavior
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: