The following program
import contextlib
import attrs
@attrs.define
class D1:
@contextlib.contextmanager
def hello(self):
yield None
@attrs.define
class D2(D1):
@contextlib.contextmanager
def hello(self):
with super().hello():
yield None
with D2().hello():
pass
raises TypeError: super(type, obj): obj must be an instance or subtype of type
If I use super(D2, self) it works fine.