I have a legitimate case for member functions not requiring a self parameter, which fails with error: Self argument missing for a non-static method (or an invalid type for self) (mypy version 0.730, python 3.7.4). MWE:
~~~py
import functools
from typing import Callable
class API:
def _login_required(meth: Callable) -> Callable:
@functools.wraps(meth)
def check_login(self, args, *kwargs):
if not self.check_login():
self.login()
return meth(args, *kwargs)
return check_login
@_login_required
def version(self):
pass
~~~
It is a member function of a class, to be used as decorator.