some examples:
from collections.abc import Iterator
from contextlib import contextmanager
class Foo:
@contextmanager
@staticmethod
def foo() -> Iterator[None]:
yield None
def bar(self):
with self.foo():
...
Foo().bar() # TypeError: Foo.foo() takes 0 positional arguments but 1 was given
from abc import abstractmethod
class Foo:
@abstractmethod # AttributeError: attribute '__isabstractmethod__' of 'property' objects is not writable
@property
def foo(self) -> int:
...
both of these errors are fixed by swapping the order of the decorators
some examples:
both of these errors are fixed by swapping the order of the decorators