I had a small problem with the design of a static method in Python. I think the following code best reflects my problem:
def decorator(func):
print callable(func)
return func
class Foo():
@decorator
@staticmethod
def bar():
return
print callable(Foo.bar)
This seems to be a mistake. I assume this occurs because when a method Foo.baris passed to the decorator, it is a function, not a method. This is the only reason I see that it cannot be called, because if we decorate a standard function, it cannot be called, as shown below.
@staticmethod
def function():
return
print callable(function)
, staticmethod / - ? , __call__, , callable, .