How do I use multiple __str__
from other classes? For example:
class A:
def __str__(self):
return "this"
class B:
def __str__(self):
return "that"
class C(A,B):
def __str__(self):
return super(C, self).__str__() + " those"
# return something(A) + " " something(B) + " those"
cc = C()
print(cc)
Output: this those
I would like the output to be: this that those
This post is almost a solution (with super()
)