Is there any way to check if a method is decorated with @staticmethod
? I need some function is_static_method(func)
with does the following:
class MyClass:
@staticmethod
def a(x: int) -> int:
return x
def b(self, x: int) -> int:
return x
def c(x: int) -> int:
return c
m = MyClass()
is_static_method(m.a) # True
is_static_method(m.b) # False
is_static_method(c) # False
So how does the function is_static_method
would look like?