I would like to change the
float.__str__
function of the build in float type (python 2)
I tried to extend this class.
class SuperFloat(float):
def __str__(self):
return 'I am' + self.__repr__()
However, when I add it it becomes a normal float
egg = SuperFloat(5)
type(egg+egg)
returns float
My ultimate goal is that also
egg += 5
stays a superfloat