The following code generates the following exception:
from overrides import overrides
class MyClass(OtherClass):
@overrides
@staticmethod
def function(data: Dict[str, Any]):
pass
Traceback (most recent call last):
....
File "file.py", line 106, in MyClass
def function(data: Dict[str, Any]):
File "...\lib\site-packages\overrides\overrides.py", line 88, in overrides
return _overrides(method, check_signature, check_at_runtime)
File "...\lib\site-packages\overrides\overrides.py", line 103, in _overrides
for super_class in _get_base_classes(sys._getframe(3), method.__globals__):
AttributeError: 'staticmethod' object has no attribute '__globals__'
It works the other way around:
from overrides import overrides
class MyClass(OtherClass):
@staticmethod
@overrides
def function(data: Dict[str, Any]):
pass
The following code generates the following exception:
It works the other way around:
I would expect that the order would not matter.
Versions: overrides-6.1.0 typing-utils-0.1.0