I was trying to research how to get the class bound method instead of the function in a decorator and was looking at attrs if it figured it out, but apparently not
>>> import attrs
... @attrs.define
... class A:
... foo: str = attrs.field()
...
... @foo.default
... def _foo_default(self):
... return "A"
...
... @attrs.define
... class B(A):
... def _foo_default(self):
... return "B"
... print(A())
... print(B())
A(foo='A')
B(foo='A') # was expecting `foo='B'` here due to overriding
Have you guys researched this topic and is there any conclusions on this?
I was trying to research how to get the class bound method instead of the function in a decorator and was looking at attrs if it figured it out, but apparently not
Have you guys researched this topic and is there any conclusions on this?