Is this behaviour possible in Python?
class A():
def __init__(self, string):
self.string = string
def __???__(self):
return self.string
a = A("world")
hw = "hello "+a
print(hw)
>>> hello world
I am aware that I can do str(a), but I was wondering if it was possible to use 'a' as if it were a string-object.
collections.UserString__radd__to control the'..' +scenario.