I've inherited a class from int
and I'm trying to create a method that increases my instance's value inside the method:
class MyInt(int):
def my_method(self, value):
#do_stuff()
self += value
I know you can't set self to anything else inside a method, it will sure change inside the method but the actual instance wont change. However, I don't know how can I fix this so that the actual instance would change, so is it even possible? If yes, then how?