the string class in python has following feature:
s = "Hello"
s.upper()
[Out] "HELLO"
s
[Out] "Hello"
This means, calling the class instance without arguments returns a string. I would like to implement this feature in my own class. The result should look like this:
a = MyClass(13.4,"Value 1")
a
[Out] 13.4
a.title()
[Out] "Value 1"
Is this possible and how can I implement it? Thank's for your help.